mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
Make backup copies of stdin, stdout, stderr as __stdin__, __stdout__,
__stderr__. These will be used by the import cleanup.
This commit is contained in:
parent
f1dc0615e9
commit
bd36dbaaa5
1 changed files with 4 additions and 0 deletions
|
@ -289,6 +289,10 @@ _PySys_Init()
|
|||
PyDict_SetItemString(sysdict, "stdin", sysin);
|
||||
PyDict_SetItemString(sysdict, "stdout", sysout);
|
||||
PyDict_SetItemString(sysdict, "stderr", syserr);
|
||||
/* Make backup copies for cleanup */
|
||||
PyDict_SetItemString(sysdict, "__stdin__", sysin);
|
||||
PyDict_SetItemString(sysdict, "__stdout__", sysout);
|
||||
PyDict_SetItemString(sysdict, "__stderr__", syserr);
|
||||
Py_XDECREF(sysin);
|
||||
Py_XDECREF(sysout);
|
||||
Py_XDECREF(syserr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue