summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2016-09-10 10:31:07 +0200
committerStefan Behnel <stefan_ml@behnel.de>2016-09-10 10:31:07 +0200
commitf041897925d67cc92fd5cb278c1b829f5163f6d7 (patch)
tree8af5219dd351ffd32d5ea85c3091eff4c5f81ca4 /setup.py
parent849d829a518316f9ee1aef78f43911ec6620110d (diff)
downloadcython-f041897925d67cc92fd5cb278c1b829f5163f6d7.tar.gz
try to fix build in Py3.2
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index ed3a72fb0..12592c536 100755
--- a/setup.py
+++ b/setup.py
@@ -190,7 +190,9 @@ def _defer_cython_import_in_py32(build_ext_orig, source_root, profile=False):
# sys.modules
dead_modules = []
- def build_extensions(self):
+ def __reimport(self):
+ if self.dead_modules:
+ return
# add path where 2to3 installed the transformed sources
# and make sure Python (re-)imports them from there
already_imported = [
@@ -203,6 +205,12 @@ def _defer_cython_import_in_py32(build_ext_orig, source_root, profile=False):
del sys.modules[module]
sys.path.insert(0, os.path.join(source_root, self.build_lib))
+ def finalize_options(self):
+ self.__reimport()
+ super(build_ext, self).finalize_options()
+
+ def build_extensions(self):
+ self.__reimport()
if profile:
from Cython.Compiler.Options import directive_defaults
directive_defaults['profile'] = True