mirror of
https://github.com/python/cpython.git
synced 2025-09-18 14:40:43 +00:00
Issue #3080: find_module() sets an empty path for builtin and frozen modules
This commit is contained in:
parent
533d78399f
commit
df75a023a0
1 changed files with 2 additions and 6 deletions
|
@ -1943,10 +1943,8 @@ find_module(PyObject *fullname, PyObject *name, PyObject *search_path_list,
|
||||||
Py_DECREF(meta_path);
|
Py_DECREF(meta_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (find_frozen(fullname) != NULL) {
|
if (find_frozen(fullname) != NULL)
|
||||||
strcpy(buf, _PyUnicode_AsString(fullname));
|
|
||||||
return &fd_frozen;
|
return &fd_frozen;
|
||||||
}
|
|
||||||
|
|
||||||
if (search_path_list == NULL) {
|
if (search_path_list == NULL) {
|
||||||
#ifdef MS_COREDLL
|
#ifdef MS_COREDLL
|
||||||
|
@ -1954,10 +1952,8 @@ find_module(PyObject *fullname, PyObject *name, PyObject *search_path_list,
|
||||||
struct filedescr *fdp;
|
struct filedescr *fdp;
|
||||||
PyObject *filename, *filename_bytes;
|
PyObject *filename, *filename_bytes;
|
||||||
#endif
|
#endif
|
||||||
if (is_builtin(name)) {
|
if (is_builtin(name))
|
||||||
strcpy(buf, _PyUnicode_AsString(name));
|
|
||||||
return &fd_builtin;
|
return &fd_builtin;
|
||||||
}
|
|
||||||
#ifdef MS_COREDLL
|
#ifdef MS_COREDLL
|
||||||
fp = _PyWin_FindRegisteredModule(name, &fdp, &filename);
|
fp = _PyWin_FindRegisteredModule(name, &fdp, &filename);
|
||||||
if (fp != NULL) {
|
if (fp != NULL) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue