Commit 7ecf30ab authored by Mark Florisson's avatar Mark Florisson

Use .pyx files for Importer to avoid distutils bytecode compilation

parent 6da41b8b
......@@ -5,6 +5,7 @@ that is not supported in certain Python versions but which is supported
by Cython.
"""
import os
import sys
import imp
......@@ -50,3 +51,15 @@ def importer(modulename, compile=False, version=None):
return _import_normal(modulename)
except SyntaxError:
return _import_compile(modulename)
def importer(modulename):
try:
# Check for an already compiled module
return __import__(modulename, None, None, [''])
except ImportError:
pass
dirname = os.path.dirname
root = dirname(dirname(dirname(os.path.abspath(__file__))))
filename = os.path.join(root, *modulename.split('.')) + ".pyx"
return pyximport.load_module(modulename, filename)
\ No newline at end of file
......@@ -1489,8 +1489,7 @@ if VALUE is not None:
return node
FusedNode = Importer.importer("Cython.Compiler.FusedNode",
version=(2, 5))
FusedNode = Importer.importer("Cython.Compiler.FusedNode")
node = FusedNode.FusedCFuncDefNode(node, env)
self.fused_function = node
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment