From: Stefan Behnel Date: Tue, 1 Jan 2008 09:52:53 +0000 (+0100) Subject: another Distutils fix: keep source directory as target if not requested otherwise X-Git-Tag: 0.9.6.14~29^2~62^2~19 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f2c37cc1eba382f79de486831a5c6cdc0dd48ed3;p=cython.git another Distutils fix: keep source directory as target if not requested otherwise --- diff --git a/Cython/Distutils/build_ext.py b/Cython/Distutils/build_ext.py index 47696762..3b828900 100644 --- a/Cython/Distutils/build_ext.py +++ b/Cython/Distutils/build_ext.py @@ -153,12 +153,13 @@ class build_ext(_build_ext.build_ext): or getattr(extension, 'pyrex_c_in_temp', 0)): target_dir = os.path.join(self.build_temp, "pyrex") else: - target_dir = "" + target_dir = None for source in sources: (base, ext) = os.path.splitext(os.path.basename(source)) if ext == ".pyx": # Cython source file - new_sources.append(os.path.join(target_dir, base + target_ext)) + output_dir = target_dir or os.path.dirname(source) + new_sources.append(os.path.join(output_dir, base + target_ext)) pyrex_sources.append(source) pyrex_targets[source] = new_sources[-1] else: