]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #11051: Reduce the number of syscalls per import.
authorCharles-François Natali <neologix@free.fr>
Wed, 7 Dec 2011 18:16:01 +0000 (19:16 +0100)
committerCharles-François Natali <neologix@free.fr>
Wed, 7 Dec 2011 18:16:01 +0000 (19:16 +0100)
Python/import.c

index 71992300987b9597d520cd216da00af19244392a..9773687f62f926aa07fff9bb9a82fa21e7d115a8 100644 (file)
@@ -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;