diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2012-08-06 11:06:51 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2012-08-06 11:06:51 +0200 |
commit | d918a5a79dd6c68f7d9da0aba830c786a84a56a9 (patch) | |
tree | c21feceb46f0d6b948248758f0d778616f020889 /pyximport | |
parent | 24294c5cba3d61f42076ceb3cba026dbfa80e7e8 (diff) | |
download | cython-d918a5a79dd6c68f7d9da0aba830c786a84a56a9.tar.gz |
simplify inplace build setup in pyxbuild.py
Diffstat (limited to 'pyximport')
-rw-r--r-- | pyximport/pyxbuild.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/pyximport/pyxbuild.py b/pyximport/pyxbuild.py index 711c152af..0ddf87c6f 100644 --- a/pyximport/pyxbuild.py +++ b/pyximport/pyxbuild.py @@ -47,6 +47,8 @@ def pyx_to_dll(filename, ext = None, force_rebuild = 0, args = [quiet, "build_ext"] if force_rebuild: args.append("--force") + if inplace: + args.append("--inplace") if HAS_CYTHON and build_in_temp: args.append("--pyrex-c-in-temp") sargs = setup_args.copy() @@ -84,15 +86,8 @@ def pyx_to_dll(filename, ext = None, force_rebuild = 0, try: obj_build_ext = dist.get_command_obj("build_ext") - orig_inplace = obj_build_ext.inplace - if inplace: - obj_build_ext.inplace = True - try: - dist.run_commands() - finally: - obj_build_ext.inplace = orig_inplace - so_path = obj_build_ext.get_outputs()[0] - if orig_inplace or inplace: + dist.run_commands() + if obj_build_ext.inplace: # Python distutils get_outputs()[ returns a wrong so_path # when --inplace ; see http://bugs.python.org/issue5977 # workaround: |