diff options
| author | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2009-03-04 01:58:09 (GMT) |
|---|---|---|
| committer | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2009-03-04 01:58:09 (GMT) |
| commit | 45b3c94acb2d32dc40d857af21ee4ded69359ee5 (patch) | |
| tree | b818adc15e89d7401f7bc949d259cfc5b7ee6f1b /Python | |
| parent | 571b37a531ef5606de5b8b555baba185cae5828f (diff) | |
| download | cpython-45b3c94acb2d32dc40d857af21ee4ded69359ee5.zip cpython-45b3c94acb2d32dc40d857af21ee4ded69359ee5.tar.gz cpython-45b3c94acb2d32dc40d857af21ee4ded69359ee5.tar.bz2 | |
Merged revisions 70157 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r70157 | hirokazu.yamamoto | 2009-03-04 10:52:10 +0900 | 1 line
Issue #5273: Fixed import failure on unicode path. (especially on windows)
........
Diffstat (limited to 'Python')
| -rw-r--r-- | Python/import.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Python/import.c b/Python/import.c index 397bfd8..998a3f1 100644 --- a/Python/import.c +++ b/Python/import.c @@ -988,13 +988,15 @@ update_compiled_module(PyCodeObject *co, char *pathname) { PyObject *oldname, *newname; - if (!PyUnicode_CompareWithASCIIString(co->co_filename, pathname)) - return 0; - - newname = PyUnicode_FromString(pathname); + newname = PyUnicode_DecodeFSDefault(pathname); if (newname == NULL) return -1; + if (!PyUnicode_Compare(co->co_filename, newname)) { + Py_DECREF(newname); + return 0; + } + oldname = co->co_filename; Py_INCREF(oldname); update_code_filenames(co, oldname, newname); |
