Skip to content

Commit 10ff25c

Browse files
authored
Merge pull request #3835 from pypa/distutils-4435cec3
Merge with distutils@4435cec3
2 parents abd6dbb + dd5ae79 commit 10ff25c

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

changelog.d/3820.misc.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Restore quoted ``#include`` argument to ``has_function``.

setuptools/_distutils/ccompiler.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ def has_function( # noqa: C901
860860
f = os.fdopen(fd, "w")
861861
try:
862862
for incl in includes:
863-
f.write("""#include %s\n""" % incl)
863+
f.write("""#include "%s"\n""" % incl)
864864
if not includes:
865865
# Use "char func(void);" as the prototype to follow
866866
# what autoconf does. This prototype does not match

setuptools/_distutils/tests/test_ccompiler.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ def test_has_function_prototype():
6666
assert compiler.has_function('exit')
6767
with pytest.deprecated_call(match='includes is deprecated'):
6868
# abort() is a valid expression with the <stdlib.h> prototype.
69-
assert compiler.has_function('abort', includes=['<stdlib.h>'])
69+
assert compiler.has_function('abort', includes=['stdlib.h'])
7070
with pytest.deprecated_call(match='includes is deprecated'):
7171
# But exit() is not valid with the actual prototype in scope.
72-
assert not compiler.has_function('exit', includes=['<stdlib.h>'])
72+
assert not compiler.has_function('exit', includes=['stdlib.h'])
7373
# And setuptools_does_not_exist is not declared or defined at all.
7474
assert not compiler.has_function('setuptools_does_not_exist')
7575
with pytest.deprecated_call(match='includes is deprecated'):
7676
assert not compiler.has_function(
77-
'setuptools_does_not_exist', includes=['<stdio.h>']
77+
'setuptools_does_not_exist', includes=['stdio.h']
7878
)
7979

8080

0 commit comments

Comments
 (0)