summaryrefslogtreecommitdiff
path: root/pyximport/pyximport.py
diff options
context:
space:
mode:
authorMatus Valo <matusvalo@users.noreply.github.com>2021-12-14 14:34:52 +0100
committerGitHub <noreply@github.com>2021-12-14 14:34:52 +0100
commited6478f85d63f36ca9f396150781087a032aecdb (patch)
tree3a961397e305515acef6c0d64f2b4b6515dd9fc0 /pyximport/pyximport.py
parent98fc9f1a47fb3585cd03eff5c7672ce4ae9d7f1f (diff)
downloadcython-ed6478f85d63f36ca9f396150781087a032aecdb.tar.gz
Use cythonize() in pyximport (GH-4339)
Closes https://github.com/cython/cython/issues/2304
Diffstat (limited to 'pyximport/pyximport.py')
-rw-r--r--pyximport/pyximport.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pyximport/pyximport.py b/pyximport/pyximport.py
index 7ff2ad219..46a5e0c6b 100644
--- a/pyximport/pyximport.py
+++ b/pyximport/pyximport.py
@@ -351,11 +351,12 @@ class PyImporter(PyxImporter):
self.uncompilable_modules = {}
self.blocked_modules = ['Cython', 'pyxbuild', 'pyximport.pyxbuild',
'distutils']
+ self.blocked_packages = ['Cython.', 'distutils.']
def find_module(self, fullname, package_path=None):
if fullname in sys.modules:
return None
- if fullname.startswith('Cython.'):
+ if any([fullname.startswith(pkg) for pkg in self.blocked_packages]):
return None
if fullname in self.blocked_modules:
# prevent infinite recursion