summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael W. Hudson <mwh@python.net>2003-08-11 12:21:40 (GMT)
committerMichael W. Hudson <mwh@python.net>2003-08-11 12:21:40 (GMT)
commit0eb81f24a6f1131795c289f8f7be602f3529e972 (patch)
treebe17d5abc8e1482deb29cece30035c7338aeecb2
parent03474027a32e9cda84e4af7679b4bf5f40bd6d65 (diff)
downloadcpython-0eb81f24a6f1131795c289f8f7be602f3529e972.zip
cpython-0eb81f24a6f1131795c289f8f7be602f3529e972.tar.gz
cpython-0eb81f24a6f1131795c289f8f7be602f3529e972.tar.bz2
Repeat my refcount & cut&paste fixes on the branch.
-rw-r--r--Python/pythonrun.c4
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)