Strip leading whitespace from input().

This commit is contained in:
Guido van Rossum 1992-03-12 17:33:52 +00:00
parent 27aaa6daa9
commit 22ebe2f4a7
1 changed files with 4 additions and 0 deletions

View File

@ -317,6 +317,7 @@ builtin_input(self, v)
FILE *out = sysgetfile("stdout", stdout);
node *n;
int err;
int c;
object *m, *d;
flushline();
if (v != NULL) {
@ -325,6 +326,9 @@ builtin_input(self, v)
}
m = add_module("__main__");
d = getmoduledict(m);
while ((c = getc(in)) != EOF && (c == ' ' || c == '\t'))
;
ungetc(c, in);
return run_file(in, "<stdin>", expr_input, d, d);
}