diff options
author | Charles-François Natali <neologix@free.fr> | 2011-12-07 19:16:01 +0100 |
---|---|---|
committer | Charles-François Natali <neologix@free.fr> | 2011-12-07 19:16:01 +0100 |
commit | 07c717edd69dd5e05901335996d83fe11d6a24e3 (patch) | |
tree | 3d03597d3ace443b23c313df27a39a7f5b28b14a /Python/import.c | |
parent | 69cd9efd6ea3aae49a583dbe36684fa1ed61b50a (diff) | |
download | cpython-07c717edd69dd5e05901335996d83fe11d6a24e3.tar.gz |
Issue #11051: Reduce the number of syscalls per import.
Diffstat (limited to 'Python/import.c')
-rw-r--r-- | Python/import.c | 3 |
1 files changed, 1 insertions, 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; |