Commit 011d2359 authored by Jeroen Demeyer's avatar Jeroen Demeyer Committed by Stefan Behnel

Keep also .i, .ii and .s files (generated by -save-temps) (GH-3017)

parent 1593b297
...@@ -916,13 +916,17 @@ class CythonCompileTestCase(unittest.TestCase): ...@@ -916,13 +916,17 @@ class CythonCompileTestCase(unittest.TestCase):
shutil.rmtree(self.workdir, ignore_errors=True) shutil.rmtree(self.workdir, ignore_errors=True)
else: else:
for rmfile in os.listdir(self.workdir): for rmfile in os.listdir(self.workdir):
ext = os.path.splitext(rmfile)[1]
if not cleanup_c_files: if not cleanup_c_files:
if (rmfile[-2:] in (".c", ".h") or # Keep C, C++ files, header files, preprocessed sources
rmfile[-4:] == ".cpp" or # and assembly sources (typically the .i and .s files
rmfile.endswith(".html") and rmfile.startswith(self.module)): # are intentionally generated when -save-temps is given)
if ext in (".c", ".cpp", ".h", ".i", ".ii", ".s"):
continue
if ext == ".html" and rmfile.startswith(self.module):
continue continue
is_shared_obj = rmfile.endswith(".so") or rmfile.endswith(".dll") is_shared_obj = ext in (".so", ".dll")
if not cleanup_lib_files and is_shared_obj: if not cleanup_lib_files and is_shared_obj:
continue continue
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment