mirror of
https://github.com/python/cpython.git
synced 2025-12-09 10:37:17 +00:00
find_module_path_list() fails if _Py_fopen() failed and raised an exception
(UnicodeEncodeError).
This commit is contained in:
parent
7edb5dfcbc
commit
925ef39949
1 changed files with 4 additions and 0 deletions
|
|
@ -1908,6 +1908,10 @@ find_module_path_list(PyObject *fullname, PyObject *name,
|
||||||
fp = _Py_fopen(filename, filemode);
|
fp = _Py_fopen(filename, filemode);
|
||||||
if (fp == NULL) {
|
if (fp == NULL) {
|
||||||
Py_DECREF(filename);
|
Py_DECREF(filename);
|
||||||
|
if (PyErr_Occurred()) {
|
||||||
|
Py_DECREF(prefix);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
match = case_ok(filename, -(Py_ssize_t)strlen(fdp->suffix), name);
|
match = case_ok(filename, -(Py_ssize_t)strlen(fdp->suffix), name);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue