Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 65763:b03779f00739 3.1
Merged revisions 85980 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r85980 | hirokazu.yamamoto | 2010-10-31 00:08:15 +0900 | 1 line
Issue #10157: Fixed refleaks in pythonrun.c. Patch by Stefan Krah.
........
| author | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> |
|---|---|
| date | Sat, 30 Oct 2010 15:43:30 +0000 |
| parents | e8c8400caa99 |
| children | 0311f62714f7 3c9232a684ae |
comparison
equal
deleted
inserted
replaced
| 65754:480e45828d4b | 65763:b03779f00739 |
|---|---|
| 257 pstderr = PyFile_NewStdPrinter(fileno(stderr)); | 257 pstderr = PyFile_NewStdPrinter(fileno(stderr)); |
| 258 if (pstderr == NULL) | 258 if (pstderr == NULL) |
| 259 Py_FatalError("Py_Initialize: can't set preliminary stderr"); | 259 Py_FatalError("Py_Initialize: can't set preliminary stderr"); |
| 260 PySys_SetObject("stderr", pstderr); | 260 PySys_SetObject("stderr", pstderr); |
| 261 PySys_SetObject("__stderr__", pstderr); | 261 PySys_SetObject("__stderr__", pstderr); |
| 262 Py_DECREF(pstderr); | |
| 262 | 263 |
| 263 _PyImport_Init(); | 264 _PyImport_Init(); |
| 264 | 265 |
| 265 _PyImportHooks_Init(); | 266 _PyImportHooks_Init(); |
| 266 | 267 |
| 593 pstderr = PyFile_NewStdPrinter(fileno(stderr)); | 594 pstderr = PyFile_NewStdPrinter(fileno(stderr)); |
| 594 if (pstderr == NULL) | 595 if (pstderr == NULL) |
| 595 Py_FatalError("Py_Initialize: can't set preliminary stderr"); | 596 Py_FatalError("Py_Initialize: can't set preliminary stderr"); |
| 596 PySys_SetObject("stderr", pstderr); | 597 PySys_SetObject("stderr", pstderr); |
| 597 PySys_SetObject("__stderr__", pstderr); | 598 PySys_SetObject("__stderr__", pstderr); |
| 599 Py_DECREF(pstderr); | |
| 598 | 600 |
| 599 _PyImportHooks_Init(); | 601 _PyImportHooks_Init(); |
| 600 if (initstdio() < 0) | 602 if (initstdio() < 0) |
| 601 Py_FatalError( | 603 Py_FatalError( |
| 602 "Py_Initialize: can't initialize sys standard streams"); | 604 "Py_Initialize: can't initialize sys standard streams"); |
| 938 const char * encoding; | 940 const char * encoding; |
| 939 encoding = _PyUnicode_AsString(encoding_attr); | 941 encoding = _PyUnicode_AsString(encoding_attr); |
| 940 if (encoding != NULL) { | 942 if (encoding != NULL) { |
| 941 _PyCodec_Lookup(encoding); | 943 _PyCodec_Lookup(encoding); |
| 942 } | 944 } |
| 945 Py_DECREF(encoding_attr); | |
| 943 } | 946 } |
| 944 PyErr_Clear(); /* Not a fatal error if codec isn't available */ | 947 PyErr_Clear(); /* Not a fatal error if codec isn't available */ |
| 945 | 948 |
| 946 PySys_SetObject("__stderr__", std); | 949 PySys_SetObject("__stderr__", std); |
| 947 PySys_SetObject("stderr", std); | 950 PySys_SetObject("stderr", std); |
