diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2016-09-10 10:31:07 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2016-09-10 10:31:07 +0200 |
commit | f041897925d67cc92fd5cb278c1b829f5163f6d7 (patch) | |
tree | 8af5219dd351ffd32d5ea85c3091eff4c5f81ca4 /setup.py | |
parent | 849d829a518316f9ee1aef78f43911ec6620110d (diff) | |
download | cython-f041897925d67cc92fd5cb278c1b829f5163f6d7.tar.gz |
try to fix build in Py3.2
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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 |