mirror of
https://github.com/python/cpython.git
synced 2025-07-18 16:55:20 +00:00
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.
This commit is contained in:
parent
c2954e5273
commit
40d20bcf1f
12 changed files with 94 additions and 64 deletions
|
@ -719,7 +719,7 @@ initstdio(void)
|
|||
}
|
||||
|
||||
/* 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 @@ initstdio(void)
|
|||
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 @@ initstdio(void)
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue