Mercurial > cpython-lru_cache-weakref
diff Python/import.c @ 68731:c1a5a7dca1ec
Issue #3080: find_module() sets an empty path for builtin and frozen modules
| author | Victor Stinner <victor.stinner@haypocalc.com> |
|---|---|
| date | Mon, 14 Mar 2011 13:40:04 -0400 |
| parents | fe1d421ca3fa |
| children | c4ccf02456d6 |
line wrap: on
line diff
--- a/Python/import.c Mon Mar 14 13:22:54 2011 -0400 +++ b/Python/import.c Mon Mar 14 13:40:04 2011 -0400 @@ -1943,10 +1943,8 @@ Py_DECREF(meta_path); } - if (find_frozen(fullname) != NULL) { - strcpy(buf, _PyUnicode_AsString(fullname)); + if (find_frozen(fullname) != NULL) return &fd_frozen; - } if (search_path_list == NULL) { #ifdef MS_COREDLL @@ -1954,10 +1952,8 @@ struct filedescr *fdp; PyObject *filename, *filename_bytes; #endif - if (is_builtin(name)) { - strcpy(buf, _PyUnicode_AsString(name)); + if (is_builtin(name)) return &fd_builtin; - } #ifdef MS_COREDLL fp = _PyWin_FindRegisteredModule(name, &fdp, &filename); if (fp != NULL) {
