Mercurial > cpython-lru_cache-weakref
diff Python/bltinmodule.c @ 702:f53dcb9a04d6 legacy-trunk
Strip leading whitespace from input().
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 12 Mar 1992 17:33:52 +0000 |
| parents | 5c18d6c57827 |
| children | 70c2f40430c7 |
line wrap: on
line diff
--- a/Python/bltinmodule.c Thu Mar 12 17:33:14 1992 +0000 +++ b/Python/bltinmodule.c Thu Mar 12 17:33:52 1992 +0000 @@ -317,6 +317,7 @@ FILE *out = sysgetfile("stdout", stdout); node *n; int err; + int c; object *m, *d; flushline(); if (v != NULL) { @@ -325,6 +326,9 @@ } 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); }
