diff options
| author | Florian Weimer <fweimer@redhat.com> | 2023-02-06 23:52:13 +0100 |
|---|---|---|
| committer | Florian Weimer <fweimer@redhat.com> | 2023-02-07 00:02:40 +0100 |
| commit | 7e751d33d42de2ce9bdb08dcd0a1bd5d5b85eed9 (patch) | |
| tree | ab7e9bb2692a7494dac11e458e48ab21866b82bf | |
| parent | 2f16327060394b21fadb6342ea83eec324512aaa (diff) | |
| download | python-setuptools-git-7e751d33d42de2ce9bdb08dcd0a1bd5d5b85eed9.tar.gz | |
distutils.ccompiler: Remove correct executable file on Windows
The previous code did not take into account the .exe file extension
on Windows.
| -rw-r--r-- | distutils/ccompiler.py | 4 | ||||
| -rw-r--r-- | distutils/tests/test_ccompiler.py | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/distutils/ccompiler.py b/distutils/ccompiler.py index 16147167..55f8a9ee 100644 --- a/distutils/ccompiler.py +++ b/distutils/ccompiler.py @@ -903,7 +903,9 @@ int main (int argc, char **argv) { except (LinkError, TypeError): return False else: - os.remove(os.path.join(self.output_dir or '', "a.out")) + os.remove( + self.executable_filename("a.out", output_dir=self.output_dir or '') + ) finally: for fn in objects: os.remove(fn) diff --git a/distutils/tests/test_ccompiler.py b/distutils/tests/test_ccompiler.py index aa4c7b35..c868a56b 100644 --- a/distutils/tests/test_ccompiler.py +++ b/distutils/tests/test_ccompiler.py @@ -55,7 +55,6 @@ def test_set_include_dirs(c_file): compiler.compile(_make_strs([c_file])) -@pytest.mark.xfail('platform.system() == "Windows"') def test_has_function_prototype(): # Issue https://github.com/pypa/setuptools/issues/3648 # Test prototype-generating behavior. |
