From 7c0b0cc9f90bbcd22dd971cff21ddb85a1a94f42 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Charles-Fran=C3=A7ois=20Natali?= Date: Wed, 7 Dec 2011 19:16:01 +0100 Subject: [PATCH] Issue #11051: Reduce the number of syscalls per import. --- Python/import.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Python/import.c b/Python/import.c index 7199230098..9773687f62 100644 --- a/Python/import.c +++ b/Python/import.c @@ -1944,8 +1944,7 @@ find_module_path_list(PyObject *fullname, PyObject *name, if (Py_VerboseFlag > 1) PySys_FormatStderr("# trying %R\n", filename); - if (_Py_stat(filename, &statbuf) == 0 && /* it exists */ - S_ISDIR(statbuf.st_mode)) /* it's a directory */ + if (_Py_stat(filename, &statbuf) != 0 || S_ISDIR(statbuf.st_mode)) { Py_DECREF(filename); continue; -- 2.40.0