comparison Python/pythonrun.c @ 62393:fa830371c724 3.1

Merged revisions 82059,82061 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r82059 | victor.stinner | 2010-06-18 01:08:50 +0200 (ven., 18 juin 2010) | 5 lines 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 :-) ........ r82061 | victor.stinner | 2010-06-18 01:17:37 +0200 (ven., 18 juin 2010) | 2 lines Issue #6543: Mention the author of the patch, Amaury Forgeot d'Arc ........
author Victor Stinner <victor.stinner@haypocalc.com>
date Thu, 17 Jun 2010 23:23:37 +0000
parents f83f201b1276
children 77c6f60a1b24
comparison
equal deleted inserted replaced
62392:07449b367935 62393:fa830371c724
1158 if (m == NULL) 1158 if (m == NULL)
1159 return -1; 1159 return -1;
1160 d = PyModule_GetDict(m); 1160 d = PyModule_GetDict(m);
1161 if (PyDict_GetItemString(d, "__file__") == NULL) { 1161 if (PyDict_GetItemString(d, "__file__") == NULL) {
1162 PyObject *f; 1162 PyObject *f;
1163 f = PyUnicode_DecodeFSDefault(filename); 1163 f = PyUnicode_FromString(filename);
1164 if (f == NULL) 1164 if (f == NULL)
1165 return -1; 1165 return -1;
1166 if (PyDict_SetItemString(d, "__file__", f) < 0) { 1166 if (PyDict_SetItemString(d, "__file__", f) < 0) {
1167 Py_DECREF(f); 1167 Py_DECREF(f);
1168 return -1; 1168 return -1;