Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 62389:907f564476be
Issue #6543: Write the traceback in the terminal encoding instead of utf-8.
Fix the encoding of the modules filename.
Reindent also traceback.h, just because I hate tabs :-)
| author | Victor Stinner <victor.stinner@haypocalc.com> |
|---|---|
| date | Thu, 17 Jun 2010 23:08:50 +0000 |
| parents | 72f774903772 |
| children | c16803bbd790 |
comparison
equal
deleted
inserted
replaced
| 62387:f3dd930665bd | 62389:907f564476be |
|---|---|
| 1188 if (m == NULL) | 1188 if (m == NULL) |
| 1189 return -1; | 1189 return -1; |
| 1190 d = PyModule_GetDict(m); | 1190 d = PyModule_GetDict(m); |
| 1191 if (PyDict_GetItemString(d, "__file__") == NULL) { | 1191 if (PyDict_GetItemString(d, "__file__") == NULL) { |
| 1192 PyObject *f; | 1192 PyObject *f; |
| 1193 f = PyUnicode_DecodeFSDefault(filename); | 1193 f = PyUnicode_FromString(filename); |
| 1194 if (f == NULL) | 1194 if (f == NULL) |
| 1195 return -1; | 1195 return -1; |
| 1196 if (PyDict_SetItemString(d, "__file__", f) < 0) { | 1196 if (PyDict_SetItemString(d, "__file__", f) < 0) { |
| 1197 Py_DECREF(f); | 1197 Py_DECREF(f); |
| 1198 return -1; | 1198 return -1; |
