Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 84800:a4998e8fd7fc
Issue #18520: Fix initstdio(), handle PySys_SetObject() failure
| author | Victor Stinner <victor.stinner@gmail.com> |
|---|---|
| date | Mon, 22 Jul 2013 23:55:19 +0200 |
| parents | d38348173c46 |
| children | 31664b304281 |
comparison
equal
deleted
inserted
replaced
| 84799:4a69dbe71aeb | 84800:a4998e8fd7fc |
|---|---|
| 1157 } | 1157 } |
| 1158 Py_DECREF(encoding_attr); | 1158 Py_DECREF(encoding_attr); |
| 1159 } | 1159 } |
| 1160 PyErr_Clear(); /* Not a fatal error if codec isn't available */ | 1160 PyErr_Clear(); /* Not a fatal error if codec isn't available */ |
| 1161 | 1161 |
| 1162 PySys_SetObject("__stderr__", std); | 1162 if (PySys_SetObject("__stderr__", std) < 0) { |
| 1163 PySys_SetObject("stderr", std); | 1163 Py_DECREF(std); |
| 1164 goto error; | |
| 1165 } | |
| 1166 if (PySys_SetObject("stderr", std) < 0) { | |
| 1167 Py_DECREF(std); | |
| 1168 goto error; | |
| 1169 } | |
| 1164 Py_DECREF(std); | 1170 Py_DECREF(std); |
| 1165 #endif | 1171 #endif |
| 1166 | 1172 |
| 1167 if (0) { | 1173 if (0) { |
| 1168 error: | 1174 error: |
