Skip to content

Commit

Permalink
Merge https://github.com/pypa/distutils into distutils-4435cec3
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Feb 20, 2023
2 parents abd6dbb + 4435cec commit d809433
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setuptools/_distutils/ccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ def has_function( # noqa: C901
f = os.fdopen(fd, "w")
try:
for incl in includes:
f.write("""#include %s\n""" % incl)
f.write("""#include "%s"\n""" % incl)
if not includes:
# Use "char func(void);" as the prototype to follow
# what autoconf does. This prototype does not match
Expand Down
6 changes: 3 additions & 3 deletions setuptools/_distutils/tests/test_ccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ def test_has_function_prototype():
assert compiler.has_function('exit')
with pytest.deprecated_call(match='includes is deprecated'):
# abort() is a valid expression with the <stdlib.h> prototype.
assert compiler.has_function('abort', includes=['<stdlib.h>'])
assert compiler.has_function('abort', includes=['stdlib.h'])
with pytest.deprecated_call(match='includes is deprecated'):
# But exit() is not valid with the actual prototype in scope.
assert not compiler.has_function('exit', includes=['<stdlib.h>'])
assert not compiler.has_function('exit', includes=['stdlib.h'])
# And setuptools_does_not_exist is not declared or defined at all.
assert not compiler.has_function('setuptools_does_not_exist')
with pytest.deprecated_call(match='includes is deprecated'):
assert not compiler.has_function(
'setuptools_does_not_exist', includes=['<stdio.h>']
'setuptools_does_not_exist', includes=['stdio.h']
)


Expand Down

0 comments on commit d809433

Please sign in to comment.