Commit c845fdaa authored by Guido van Rossum's avatar Guido van Rossum

Skip leading whitespace of eval() string argument.

parent 90a927fd
......@@ -148,6 +148,7 @@ exec_eval(v, start)
int start;
{
object *str = NULL, *globals = NULL, *locals = NULL;
char *s;
int n;
if (v != NULL) {
if (is_stringobject(v))
......@@ -167,7 +168,12 @@ exec_eval(v, start)
"exec/eval arguments must be string[,dict[,dict]]");
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 *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment