From 4f4fc49c6f3ec3c77867fb84a55520369bfd5106 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sun, 25 Jan 2009 19:11:43 +0100 Subject: [PATCH] make pyximport work with empty path entries in sys.path (== CWD) --- pyximport/pyximport.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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), -- 2.26.2