Issue #11051: Reduce the number of syscalls per import.
diff --git a/Python/import.c b/Python/import.c
index 7199230..9773687 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -1944,8 +1944,7 @@
             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;