diff options
author | Michael W. Hudson <mwh@python.net> | 2003-08-11 12:20:24 (GMT) |
---|---|---|
committer | Michael W. Hudson <mwh@python.net> | 2003-08-11 12:20:24 (GMT) |
commit | 68debc935b01b55ab4daf4032131101f86dc750e (patch) | |
tree | 544233f9e65e45d19654576b5c84528edea893da /Python | |
parent | 0fd54d8050f2a4181066c185e6ac465133646f05 (diff) | |
download | cpython-68debc935b01b55ab4daf4032131101f86dc750e.zip cpython-68debc935b01b55ab4daf4032131101f86dc750e.tar.gz cpython-68debc935b01b55ab4daf4032131101f86dc750e.tar.bz2 |
Fix refcounting and cut & paste error (?) in last checkin.
This should go onto release23-maint, too.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/pythonrun.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index f82de0a..018400c 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -252,7 +252,7 @@ Py_Initialize(void) setlocale(LC_CTYPE, saved_locale); if (codeset) { - sys_stream = PySys_GetObject("stdout"); + sys_stream = PySys_GetObject("stdin"); sys_isatty = PyObject_CallMethod(sys_stream, "isatty", ""); if (!sys_isatty) PyErr_Clear(); @@ -260,7 +260,6 @@ Py_Initialize(void) if (!PyFile_SetEncoding(sys_stream, codeset)) Py_FatalError("Cannot set codeset of stdin"); } - Py_XDECREF(sys_stream); Py_XDECREF(sys_isatty); sys_stream = PySys_GetObject("stdout"); @@ -271,7 +270,6 @@ Py_Initialize(void) if (!PyFile_SetEncoding(sys_stream, codeset)) Py_FatalError("Cannot set codeset of stdout"); } - Py_XDECREF(sys_stream); Py_XDECREF(sys_isatty); if (!Py_FileSystemDefaultEncoding) |