Issue #11051: Reduce the number of syscalls per import.
This commit is contained in:
parent
3be637e67f
commit
7c0b0cc9f9
|
@ -1944,8 +1944,7 @@ find_module_path_list(PyObject *fullname, PyObject *name,
|
||||||
if (Py_VerboseFlag > 1)
|
if (Py_VerboseFlag > 1)
|
||||||
PySys_FormatStderr("# trying %R\n", filename);
|
PySys_FormatStderr("# trying %R\n", filename);
|
||||||
|
|
||||||
if (_Py_stat(filename, &statbuf) == 0 && /* it exists */
|
if (_Py_stat(filename, &statbuf) != 0 || S_ISDIR(statbuf.st_mode))
|
||||||
S_ISDIR(statbuf.st_mode)) /* it's a directory */
|
|
||||||
{
|
{
|
||||||
Py_DECREF(filename);
|
Py_DECREF(filename);
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue