diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2008-06-01 07:20:46 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2008-06-01 07:20:46 (GMT) |
commit | 99815892f685e9ab20dfdade9c1e8a295139140c (patch) | |
tree | 92d2aeaee0a925df71471b296c5fa7ff28a451b8 /Python/sysmodule.c | |
parent | 7f7ca35f5bf22b698135de62d2179a13f5c94c7f (diff) | |
download | cpython-99815892f685e9ab20dfdade9c1e8a295139140c.zip cpython-99815892f685e9ab20dfdade9c1e8a295139140c.tar.gz cpython-99815892f685e9ab20dfdade9c1e8a295139140c.tar.bz2 |
New environment variable PYTHONIOENCODING.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r-- | Python/sysmodule.c | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index b248429..e4fcc50 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -1232,9 +1232,6 @@ _PySys_Init(void) PyObject *m, *v, *sysdict; PyObject *sysin, *sysout, *syserr; char *s; -#ifdef MS_WINDOWS - char buf[128]; -#endif m = Py_InitModule3("sys", sys_methods, sys_doc); if (m == NULL) @@ -1272,23 +1269,6 @@ _PySys_Init(void) syserr = PyFile_FromFile(stderr, "<stderr>", "w", _check_and_flush); if (PyErr_Occurred()) return NULL; -#ifdef MS_WINDOWS - if(isatty(_fileno(stdin)) && PyFile_Check(sysin)) { - sprintf(buf, "cp%d", GetConsoleCP()); - if (!PyFile_SetEncoding(sysin, buf)) - return NULL; - } - if(isatty(_fileno(stdout)) && PyFile_Check(sysout)) { - sprintf(buf, "cp%d", GetConsoleOutputCP()); - if (!PyFile_SetEncoding(sysout, buf)) - return NULL; - } - if(isatty(_fileno(stderr)) && PyFile_Check(syserr)) { - sprintf(buf, "cp%d", GetConsoleOutputCP()); - if (!PyFile_SetEncoding(syserr, buf)) - return NULL; - } -#endif PyDict_SetItemString(sysdict, "stdin", sysin); PyDict_SetItemString(sysdict, "stdout", sysout); |