Skip to content

Commit 7e751d3

Browse files
committed
distutils.ccompiler: Remove correct executable file on Windows
The previous code did not take into account the .exe file extension on Windows.
1 parent 2f16327 commit 7e751d3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

distutils/ccompiler.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,9 @@ def has_function( # noqa: C901
903903
except (LinkError, TypeError):
904904
return False
905905
else:
906-
os.remove(os.path.join(self.output_dir or '', "a.out"))
906+
os.remove(
907+
self.executable_filename("a.out", output_dir=self.output_dir or '')
908+
)
907909
finally:
908910
for fn in objects:
909911
os.remove(fn)

distutils/tests/test_ccompiler.py

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ def test_set_include_dirs(c_file):
5555
compiler.compile(_make_strs([c_file]))
5656

5757

58-
@pytest.mark.xfail('platform.system() == "Windows"')
5958
def test_has_function_prototype():
6059
# Issue https://github.com/pypa/setuptools/issues/3648
6160
# Test prototype-generating behavior.

0 commit comments

Comments
 (0)