commit | 925ef39949b784d331dbb246b8888347ecd8b275 | [log] [tgz] |
---|---|---|
author | Victor Stinner <victor.stinner@haypocalc.com> | Mon Jun 20 15:01:10 2011 +0200 |
committer | Victor Stinner <victor.stinner@haypocalc.com> | Mon Jun 20 15:01:10 2011 +0200 |
tree | d0851a1a09d7dacf5baf7abcbec0b192a3d98937 | |
parent | 7edb5dfcbc815e2479e4c68051bf1805d1c9348d [diff] [blame] |
find_module_path_list() fails if _Py_fopen() failed and raised an exception (UnicodeEncodeError).
diff --git a/Python/import.c b/Python/import.c index 9ec8cd8..de5dc0c 100644 --- a/Python/import.c +++ b/Python/import.c
@@ -1908,6 +1908,10 @@ fp = _Py_fopen(filename, filemode); if (fp == NULL) { Py_DECREF(filename); + if (PyErr_Occurred()) { + Py_DECREF(prefix); + return NULL; + } continue; } match = case_ok(filename, -(Py_ssize_t)strlen(fdp->suffix), name);