mirror of
https://github.com/python/cpython.git
synced 2025-09-01 06:28:36 +00:00
Skip leading whitespace of eval() string argument.
This commit is contained in:
parent
e785fbcfa7
commit
f08ab0ad15
1 changed files with 7 additions and 1 deletions
|
@ -148,6 +148,7 @@ exec_eval(v, start)
|
||||||
int start;
|
int start;
|
||||||
{
|
{
|
||||||
object *str = NULL, *globals = NULL, *locals = NULL;
|
object *str = NULL, *globals = NULL, *locals = NULL;
|
||||||
|
char *s;
|
||||||
int n;
|
int n;
|
||||||
if (v != NULL) {
|
if (v != NULL) {
|
||||||
if (is_stringobject(v))
|
if (is_stringobject(v))
|
||||||
|
@ -167,7 +168,12 @@ exec_eval(v, start)
|
||||||
"exec/eval arguments must be string[,dict[,dict]]");
|
"exec/eval arguments must be string[,dict[,dict]]");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return run_string(getstringvalue(str), start, globals, locals);
|
s = getstringvalue(str);
|
||||||
|
if (start == eval_input) {
|
||||||
|
while (*s == ' ' || *s == '\t')
|
||||||
|
s++;
|
||||||
|
}
|
||||||
|
return run_string(s, start, globals, locals);
|
||||||
}
|
}
|
||||||
|
|
||||||
static object *
|
static object *
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue