mirror of https://github.com/python/cpython
MacPython-OS9 specific fix: If there are non-string items on sys.path don't try to intern them. This has the theoretical problem that resource filenames on sys.path cannot be unicode objects, but in practice that shouldn't matter.
This commit is contained in:
parent
0064026668
commit
9363dca3f8
|
@ -1214,8 +1214,10 @@ find_module(char *fullname, char *subname, PyObject *path, char *buf,
|
||||||
** Speedup: each sys.path item is interned, and
|
** Speedup: each sys.path item is interned, and
|
||||||
** FindResourceModule remembers which items refer to
|
** FindResourceModule remembers which items refer to
|
||||||
** folders (so we don't have to bother trying to look
|
** folders (so we don't have to bother trying to look
|
||||||
** into them for resources).
|
** into them for resources). We only do this for string
|
||||||
|
** items.
|
||||||
*/
|
*/
|
||||||
|
if (PyString_Check(PyList_GET_ITEM(path, i))) {
|
||||||
PyString_InternInPlace(&PyList_GET_ITEM(path, i));
|
PyString_InternInPlace(&PyList_GET_ITEM(path, i));
|
||||||
v = PyList_GET_ITEM(path, i);
|
v = PyList_GET_ITEM(path, i);
|
||||||
if (PyMac_FindResourceModule((PyStringObject *)v, name, buf)) {
|
if (PyMac_FindResourceModule((PyStringObject *)v, name, buf)) {
|
||||||
|
@ -1232,6 +1234,7 @@ find_module(char *fullname, char *subname, PyObject *path, char *buf,
|
||||||
Py_XDECREF(copy);
|
Py_XDECREF(copy);
|
||||||
return &resfiledescr;
|
return &resfiledescr;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
if (len > 0 && buf[len-1] != SEP
|
if (len > 0 && buf[len-1] != SEP
|
||||||
#ifdef ALTSEP
|
#ifdef ALTSEP
|
||||||
|
|
Loading…
Reference in New Issue