summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-03-04 16:41:41 (GMT)
committerGuido van Rossum <guido@python.org>1992-03-04 16:41:41 (GMT)
commitf08ab0ad158f88f05dd923b129d2397e1882be14 (patch)
treebf71b67d26d1642ae1686e5b33bfecd13f96aba7 /Python/bltinmodule.c
parente785fbcfa7f25feaf3673b9666a80d786e46448c (diff)
downloadcpython-f08ab0ad158f88f05dd923b129d2397e1882be14.zip
cpython-f08ab0ad158f88f05dd923b129d2397e1882be14.tar.gz
cpython-f08ab0ad158f88f05dd923b129d2397e1882be14.tar.bz2
Skip leading whitespace of eval() string argument.
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index bf4d3fd..8c8d60c 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 *