Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7c9875c commit 4f447fbCopy full SHA for 4f447fb
1 file changed
Python/import.c
@@ -990,13 +990,15 @@ update_compiled_module(PyCodeObject *co, char *pathname)
990
{
991
PyObject *oldname, *newname;
992
993
- if (!PyUnicode_CompareWithASCIIString(co->co_filename, pathname))
994
- return 0;
995
-
996
- newname = PyUnicode_FromString(pathname);
+ newname = PyUnicode_DecodeFSDefault(pathname);
997
if (newname == NULL)
998
return -1;
999
+ if (!PyUnicode_Compare(co->co_filename, newname)) {
+ Py_DECREF(newname);
+ return 0;
1000
+ }
1001
+
1002
oldname = co->co_filename;
1003
Py_INCREF(oldname);
1004
update_code_filenames(co, oldname, newname);
0 commit comments