From: Stefan Behnel Date: Sun, 25 Jan 2009 18:11:43 +0000 (+0100) Subject: make pyximport work with empty path entries in sys.path (== CWD) X-Git-Tag: 0.11.rc~102 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4f4fc49c6f3ec3c77867fb84a55520369bfd5106;p=cython.git make pyximport work with empty path entries in sys.path (== CWD) --- diff --git a/pyximport/pyximport.py b/pyximport/pyximport.py index 542bb5eb..2aa1bf20 100644 --- a/pyximport/pyximport.py +++ b/pyximport/pyximport.py @@ -176,7 +176,13 @@ class PyxImporter(object): paths = sys.path join_path = os.path.join is_file = os.path.isfile - for path in filter(os.path.isdir, paths): + is_dir = os.path.isdir + for path in paths: + if not is_dir(path): + if not path: + path = os.getcwd() + else: + continue for filename in os.listdir(path): if filename == pyx_module_name: return PyxLoader(fullname, join_path(path, filename),