@@ -, +, @@ filenames (mostly for windows) (GH-4630)" --- pyximport/_pyximport2.py | 26 ++++++-------------------- pyximport/_pyximport3.py | 26 ++++++-------------------- 2 files changed, 12 insertions(+), 40 deletions(-) --- a/pyximport/_pyximport2.py +++ a/pyximport/_pyximport2.py @@ -185,26 +185,12 @@ def build_module(name, pyxfilename, pyxbuild_dir=None, inplace=False, language_l build_in_temp = sargs.pop('build_in_temp',build_in_temp) from . import pyxbuild - olddir = os.getcwd() - common = '' - if pyxbuild_dir: - # Windows concatenates the pyxbuild_dir to the pyxfilename when - # compiling, and then complains that the filename is too long - common = os.path.commonprefix([pyxbuild_dir, pyxfilename]) - if len(common) > 30: - pyxfilename = os.path.relpath(pyxfilename) - pyxbuild_dir = os.path.relpath(pyxbuild_dir) - os.chdir(common) - try: - so_path = pyxbuild.pyx_to_dll(pyxfilename, extension_mod, - build_in_temp=build_in_temp, - pyxbuild_dir=pyxbuild_dir, - setup_args=sargs, - inplace=inplace, - reload_support=pyxargs.reload_support) - finally: - os.chdir(olddir) - so_path = os.path.join(common, so_path) + so_path = pyxbuild.pyx_to_dll(pyxfilename, extension_mod, + build_in_temp=build_in_temp, + pyxbuild_dir=pyxbuild_dir, + setup_args=sargs, + inplace=inplace, + reload_support=pyxargs.reload_support) assert os.path.exists(so_path), "Cannot find: %s" % so_path junkpath = os.path.join(os.path.dirname(so_path), name+"_*") #very dangerous with --inplace ? yes, indeed, trying to eat my files ;) --- a/pyximport/_pyximport3.py +++ a/pyximport/_pyximport3.py @@ -183,26 +183,12 @@ def build_module(name, pyxfilename, pyxbuild_dir=None, inplace=False, language_l build_in_temp = sargs.pop('build_in_temp',build_in_temp) from . import pyxbuild - olddir = os.getcwd() - common = '' - if pyxbuild_dir: - # Windows concatenates the pyxbuild_dir to the pyxfilename when - # compiling, and then complains that the filename is too long - common = os.path.commonprefix([pyxbuild_dir, pyxfilename]) - if len(common) > 30: - pyxfilename = os.path.relpath(pyxfilename) - pyxbuild_dir = os.path.relpath(pyxbuild_dir) - os.chdir(common) - try: - so_path = pyxbuild.pyx_to_dll(pyxfilename, extension_mod, - build_in_temp=build_in_temp, - pyxbuild_dir=pyxbuild_dir, - setup_args=sargs, - inplace=inplace, - reload_support=pyxargs.reload_support) - finally: - os.chdir(olddir) - so_path = os.path.join(common, so_path) + so_path = pyxbuild.pyx_to_dll(pyxfilename, extension_mod, + build_in_temp=build_in_temp, + pyxbuild_dir=pyxbuild_dir, + setup_args=sargs, + inplace=inplace, + reload_support=pyxargs.reload_support) assert os.path.exists(so_path), "Cannot find: %s" % so_path junkpath = os.path.join(os.path.dirname(so_path), name+"_*") #very dangerous with --inplace ? yes, indeed, trying to eat my files ;) --