Mercurial > cpython-lru_cache-weakref
diff Python/pythonrun.c @ 43632:0067a6ab4854
Issue 1267, continued.
Additional patch by Christian Heimes to deal more cleanly with the
FILE* vs file-descriptor issues.
I cleaned up his code a bit, and moved the lseek() call into import.c.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 22 Oct 2007 00:09:51 +0000 |
| parents | a2bb76d11d66 |
| children | 00b136b7da84 |
line wrap: on
line diff
--- a/Python/pythonrun.c Sun Oct 21 02:45:33 2007 +0000 +++ b/Python/pythonrun.c Mon Oct 22 00:09:51 2007 +0000 @@ -719,7 +719,7 @@ } /* Set sys.stdin */ - if (!(std = PyFile_FromFileEx(stdin, "<stdin>", "r", fclose, -1, + if (!(std = PyFile_FromFd(fileno(stdin), "<stdin>", "r", -1, NULL, "\n"))) { goto error; } @@ -728,7 +728,7 @@ Py_DECREF(std); /* Set sys.stdout */ - if (!(std = PyFile_FromFileEx(stdout, "<stdout>", "w", fclose, -1, + if (!(std = PyFile_FromFd(fileno(stdout), "<stdout>", "w", -1, NULL, "\n"))) { goto error; } @@ -737,7 +737,7 @@ Py_DECREF(std); /* Set sys.stderr */ - if (!(std = PyFile_FromFileEx(stderr, "<stderr>", "w", fclose, -1, + if (!(std = PyFile_FromFd(fileno(stderr), "<stderr>", "w", -1, NULL, "\n"))) { goto error; }
