From: Charles-François Natali Date: Wed, 7 Dec 2011 18:16:01 +0000 (+0100) Subject: Issue #11051: Reduce the number of syscalls per import. X-Git-Tag: v3.3.0a1~668 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7c0b0cc9f90bbcd22dd971cff21ddb85a1a94f42;p=thirdparty%2FPython%2Fcpython.git Issue #11051: Reduce the number of syscalls per import. --- diff --git a/Python/import.c b/Python/import.c index 71992300987b..9773687f62f9 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;