summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorCharles-François Natali <neologix@free.fr>2011-12-07 18:16:01 (GMT)
committerCharles-François Natali <neologix@free.fr>2011-12-07 18:16:01 (GMT)
commit7c0b0cc9f90bbcd22dd971cff21ddb85a1a94f42 (patch)
tree4bb1aa411a90cca41e4cec74a204bbfeb8a8256c /Python
parent3be637e67f9840d93dd3379aa04015ed6502427e (diff)
downloadcpython-7c0b0cc9f90bbcd22dd971cff21ddb85a1a94f42.zip
cpython-7c0b0cc9f90bbcd22dd971cff21ddb85a1a94f42.tar.gz
cpython-7c0b0cc9f90bbcd22dd971cff21ddb85a1a94f42.tar.bz2
Issue #11051: Reduce the number of syscalls per import.
Diffstat (limited to 'Python')
-rw-r--r--Python/import.c3
1 files changed, 1 insertions, 2 deletions
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 @@ 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;