|
1 |
| -import os |
2 | 1 | import platform
|
3 |
| -import sys |
4 | 2 | import sysconfig
|
5 | 3 | import textwrap
|
6 | 4 |
|
|
11 | 9 | pytestmark = pytest.mark.usefixtures('suppress_path_mangle')
|
12 | 10 |
|
13 | 11 |
|
14 |
| -def _make_strs(paths): |
15 |
| - """ |
16 |
| - Convert paths to strings for legacy compatibility. |
17 |
| - """ |
18 |
| - if sys.version_info >= (3, 8) and platform.system() != "Windows": |
19 |
| - return paths |
20 |
| - return list(map(os.fspath, paths)) |
21 |
| - |
22 |
| - |
23 | 12 | @pytest.fixture
|
24 | 13 | def c_file(tmp_path):
|
25 | 14 | c_file = tmp_path / 'foo.c'
|
@@ -50,11 +39,11 @@ def test_set_include_dirs(c_file):
|
50 | 39 | compiler = base.new_compiler()
|
51 | 40 | python = sysconfig.get_paths()['include']
|
52 | 41 | compiler.set_include_dirs([python])
|
53 |
| - compiler.compile(_make_strs([c_file])) |
| 42 | + compiler.compile([c_file]) |
54 | 43 |
|
55 | 44 | # do it again, setting include dirs after any initialization
|
56 | 45 | compiler.set_include_dirs([python])
|
57 |
| - compiler.compile(_make_strs([c_file])) |
| 46 | + compiler.compile([c_file]) |
58 | 47 |
|
59 | 48 |
|
60 | 49 | def test_has_function_prototype():
|
@@ -88,7 +77,7 @@ def test_include_dirs_after_multiple_compile_calls(c_file):
|
88 | 77 | compiler = base.new_compiler()
|
89 | 78 | python = sysconfig.get_paths()['include']
|
90 | 79 | compiler.set_include_dirs([python])
|
91 |
| - compiler.compile(_make_strs([c_file])) |
| 80 | + compiler.compile([c_file]) |
92 | 81 | assert compiler.include_dirs == [python]
|
93 |
| - compiler.compile(_make_strs([c_file])) |
| 82 | + compiler.compile([c_file]) |
94 | 83 | assert compiler.include_dirs == [python]
|
0 commit comments