From 447bf748195561d808d328964f1bb428e4cf92de Mon Sep 17 00:00:00 2001 From: Igor Kaplounenko Date: Thu, 11 Apr 2019 13:17:37 -0700 Subject: pyimport=True should work now on darwin without having to pre-import distutils directly or via pyxbuild --- pyximport/pyximport.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pyximport') diff --git a/pyximport/pyximport.py b/pyximport/pyximport.py index 5628f301b..9e9b37c6b 100644 --- a/pyximport/pyximport.py +++ b/pyximport/pyximport.py @@ -351,6 +351,9 @@ class PyImporter(PyxImporter): self.uncompilable_modules = {} self.blocked_modules = ['Cython', 'pyxbuild', 'pyximport.pyxbuild', 'distutils.extension', 'distutils.sysconfig'] + # on OS X, distutils appears to shadow distutils.sysconfig + if os.name is 'posix' and os.uname()[0].lower().startswith('darwin'): + self.blocked_modules.append('distutils') def find_module(self, fullname, package_path=None): if fullname in sys.modules: -- cgit v1.2.1