summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorMichael W. Hudson <mwh@python.net>2003-08-11 12:20:24 +0000
committerMichael W. Hudson <mwh@python.net>2003-08-11 12:20:24 +0000
commit791ac8ac8b38e3393caf430d54c54ef65059868f (patch)
treefa7a1f0f15cf582511dd6d4dcd830456e1606564 /Python/pythonrun.c
parenta96d0a03ffb4f1da33555d66a033a5838f014c16 (diff)
downloadcpython-791ac8ac8b38e3393caf430d54c54ef65059868f.tar.gz
Fix refcounting and cut & paste error (?) in last checkin.
This should go onto release23-maint, too.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index f82de0adbe..018400cb92 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)