summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2022-08-06 12:17:13 -0400
committerJason R. Coombs <jaraco@jaraco.com>2022-08-08 16:12:59 -0400
commitdc1130766d356e1e9a613ba924e4af942631428c (patch)
treedbb0f8f3d6dca39d19ef51f61a7ef034afb7684c
parent80dd6f7c2b3b16e638ab5d836758d5b60c8a82d5 (diff)
downloadpython-setuptools-git-dc1130766d356e1e9a613ba924e4af942631428c.tar.gz
Add compatibility for Python 3.7
-rw-r--r--distutils/tests/test_ccompiler.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/distutils/tests/test_ccompiler.py b/distutils/tests/test_ccompiler.py
index 9dfa918b..3dff273a 100644
--- a/distutils/tests/test_ccompiler.py
+++ b/distutils/tests/test_ccompiler.py
@@ -1,7 +1,18 @@
+import os
+import sys
from distutils import ccompiler
+def _make_strs(paths):
+ """
+ Convert paths to strings for legacy compatibility.
+ """
+ if sys.version_info > (3, 8):
+ return paths
+ return list(map(os.fspath, paths))
+
+
def test_set_include_dirs(tmp_path):
"""
Extensions should build even if set_include_dirs is invoked.
@@ -11,4 +22,4 @@ def test_set_include_dirs(tmp_path):
c_file.write_text('void PyInit_foo(void) {}\n')
compiler = ccompiler.new_compiler()
compiler.set_include_dirs([])
- compiler.compile([c_file])
+ compiler.compile(_make_strs([c_file]))