diff options
author | Guido van Rossum <guido@python.org> | 1998-02-19 20:53:06 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-02-19 20:53:06 +0000 |
commit | 14c5128476a9cc2ba96881aabeb2f26960c98f57 (patch) | |
tree | 2d8a811c9a72b554352122708936b10aff50acbc /Python/sysmodule.c | |
parent | bd446962924feaed73c11b68fd4b1c1656679dad (diff) | |
download | cpython-14c5128476a9cc2ba96881aabeb2f26960c98f57.tar.gz |
Make backup copies of stdin, stdout, stderr as __stdin__, __stdout__,
__stderr__. These will be used by the import cleanup.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r-- | Python/sysmodule.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 665d17c3eb..b3bb919e00 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -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); |