From f2c37cc1eba382f79de486831a5c6cdc0dd48ed3 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Tue, 1 Jan 2008 10:52:53 +0100 Subject: [PATCH] another Distutils fix: keep source directory as target if not requested otherwise --- Cython/Distutils/build_ext.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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: -- 2.26.2