From: Guido van Rossum Date: Wed, 4 Mar 1992 16:41:41 +0000 (+0000) Subject: Skip leading whitespace of eval() string argument. X-Git-Tag: v0.9.8~489 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f08ab0ad158f88f05dd923b129d2397e1882be14;p=thirdparty%2FPython%2Fcpython.git Skip leading whitespace of eval() string argument. --- diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index bf4d3fd9ed6c..8c8d60c642d8 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -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 *