diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-03-14 17:40:04 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-03-14 17:40:04 (GMT) |
commit | df75a023a018be6bf2c579e23eaa4fd8015ab226 (patch) | |
tree | 217a3c5cc951f9e1786a8fff5e744424e1e863d6 | |
parent | 533d78399f471411b5c37a003dec7688435bf270 (diff) | |
download | cpython-df75a023a018be6bf2c579e23eaa4fd8015ab226.zip cpython-df75a023a018be6bf2c579e23eaa4fd8015ab226.tar.gz cpython-df75a023a018be6bf2c579e23eaa4fd8015ab226.tar.bz2 |
Issue #3080: find_module() sets an empty path for builtin and frozen modules
-rw-r--r-- | Python/import.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Python/import.c b/Python/import.c index 73d38fe..2c21112 100644 --- a/Python/import.c +++ b/Python/import.c @@ -1943,10 +1943,8 @@ find_module(PyObject *fullname, PyObject *name, PyObject *search_path_list, 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 @@ find_module(PyObject *fullname, PyObject *name, PyObject *search_path_list, 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) { |