summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pyximport/pyximport.py3
-rw-r--r--tests/pyximport/pyximport_pyimport_slow.srctree21
2 files changed, 24 insertions, 0 deletions
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:
diff --git a/tests/pyximport/pyximport_pyimport_slow.srctree b/tests/pyximport/pyximport_pyimport_slow.srctree
new file mode 100644
index 000000000..61df65ce8
--- /dev/null
+++ b/tests/pyximport/pyximport_pyimport_slow.srctree
@@ -0,0 +1,21 @@
+
+PYTHON -c "import pyimport_test; pyimport_test.test()"
+
+######## pyimport_test.py ########
+
+import os.path
+
+import pyximport
+
+
+pyximport.install(pyximport=False, pyimport=True,
+ build_dir=os.path.join(os.path.dirname(__file__), "TEST_TMP"))
+
+def test():
+ import mymodule
+ assert mymodule.test_string == "TEST"
+ assert not mymodule.__file__.rstrip('oc').endswith('.py'), mymodule.__file__
+
+######## mymodule.py ########
+
+test_string = "TEST"