mirror of
https://github.com/python/cpython.git
synced 2025-07-16 15:55:18 +00:00
Issue #14605: Use None in sys.path_importer_cache to represent no
finder instead of using some (now non-existent) implicit finder.
This commit is contained in:
parent
9e66ac683c
commit
aa93642a35
7 changed files with 1096 additions and 1172 deletions
|
@ -1186,15 +1186,7 @@ get_path_importer(PyObject *path_importer_cache, PyObject *path_hooks,
|
|||
PyErr_Clear();
|
||||
}
|
||||
if (importer == NULL) {
|
||||
importer = PyObject_CallFunctionObjArgs(
|
||||
(PyObject *)&PyNullImporter_Type, p, NULL
|
||||
);
|
||||
if (importer == NULL) {
|
||||
if (PyErr_ExceptionMatches(PyExc_ImportError)) {
|
||||
PyErr_Clear();
|
||||
return Py_None;
|
||||
}
|
||||
}
|
||||
return Py_None;
|
||||
}
|
||||
if (importer != NULL) {
|
||||
int err = PyDict_SetItem(path_importer_cache, p, importer);
|
||||
|
|
2187
Python/importlib.h
2187
Python/importlib.h
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue