From c61b62d60bde6898d2fafca6553dab511b952a74 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 22 Oct 2007 00:09:51 +0000 Subject: 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. --- Python/pythonrun.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Python/pythonrun.c') diff --git a/Python/pythonrun.c b/Python/pythonrun.c index f641547afd..330667a219 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -719,7 +719,7 @@ initstdio(void) } /* Set sys.stdin */ - if (!(std = PyFile_FromFileEx(stdin, "", "r", fclose, -1, + if (!(std = PyFile_FromFd(fileno(stdin), "", "r", -1, NULL, "\n"))) { goto error; } @@ -728,7 +728,7 @@ initstdio(void) Py_DECREF(std); /* Set sys.stdout */ - if (!(std = PyFile_FromFileEx(stdout, "", "w", fclose, -1, + if (!(std = PyFile_FromFd(fileno(stdout), "", "w", -1, NULL, "\n"))) { goto error; } @@ -737,7 +737,7 @@ initstdio(void) Py_DECREF(std); /* Set sys.stderr */ - if (!(std = PyFile_FromFileEx(stderr, "", "w", fclose, -1, + if (!(std = PyFile_FromFd(fileno(stderr), "", "w", -1, NULL, "\n"))) { goto error; } -- cgit v1.2.1