Skip to content

Commit 9df4917

Browse files
wasm-sourcemap.py: fix handling of paths on different drives (emscripten-core#12136)
Fixed issue with code files included from different drives (Windows), where wasm-sourcemap.py would bail out with an error Fixes: emscripten-core#12111
1 parent 0b3158a commit 9df4917

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tools/wasm-sourcemap.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,10 @@ def build_sourcemap(entries, code_section_offset, prefixes, collect_sources, bas
279279
if prefixes.provided():
280280
source_name = prefixes.sources.resolve(file_name)
281281
else:
282-
file_name = os.path.relpath(os.path.abspath(file_name), base_path)
282+
try:
283+
file_name = os.path.relpath(file_name, base_path)
284+
except ValueError:
285+
file_name = os.path.abspath(file_name)
283286
file_name = normalize_path(file_name)
284287
source_name = file_name
285288
if source_name not in sources_map:

0 commit comments

Comments
 (0)