Skip to content

Commit 0e1522f

Browse files
authored
Fix test other.test_abspaths (#24451)
Python 3.13 changed behavior so that `os.path.isabs('/foo/bar')` now returns `False` when run on Windows.
1 parent 960fe78 commit 0e1522f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

emcc.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1295,7 +1295,9 @@ def consume_arg_file():
12951295
exit_with_error('cannot --separate-asm with the wasm backend, since not emitting asm.js')
12961296
elif arg.startswith(('-I', '-L')):
12971297
path_name = arg[2:]
1298-
if os.path.isabs(path_name) and not is_valid_abspath(options, path_name):
1298+
# Look for '/' explicitly so that we can also diagnose identically if -I/foo/bar is passed on Windows.
1299+
# Python since 3.13 does not treat '/foo/bar' as an absolute path on Windows.
1300+
if (path_name.startswith('/') or os.path.isabs(path_name)) and not is_valid_abspath(options, path_name):
12991301
# Of course an absolute path to a non-system-specific library or header
13001302
# is fine, and you can ignore this warning. The danger are system headers
13011303
# that are e.g. x86 specific and non-portable. The emscripten bundled

test/test_other.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1760,7 +1760,6 @@ def test_ungetc_fscanf(self):
17601760
self.emcc('main.c', ['--embed-file', 'my_test.input'], output_filename='a.out.js')
17611761
self.assertContained('zyx', self.run_process(config.JS_ENGINES[0] + ['a.out.js'], stdout=PIPE, stderr=PIPE).stdout)
17621762

1763-
@no_windows('This test is written to work on Linux and macOS only')
17641763
def test_abspaths(self):
17651764
# Includes with absolute paths are generally dangerous, things like -I/usr/.. will get to system
17661765
# local headers, not our portable ones.

0 commit comments

Comments
 (0)