Skip to content

Commit 11fc658

Browse files
committed
Path transformer: handle Windows-style paths
1 parent 820245b commit 11fc658

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

python/extractor/semmle/projectlayout.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@
1212
import re
1313
from functools import total_ordering
1414
import sys
15+
from pathlib import PureWindowsPath
16+
import os
1517

1618
def get_renamer(filename, logger):
1719
layout = load(filename, logger)
1820
def rename(path):
1921
renamed = layout.artificial_path(path)
2022
return path if renamed is None else renamed
23+
if os.name == "nt":
24+
return lambda path: rename(PureWindowsPath(path).as_posix())
2125
return rename
2226

2327
def load(filename, logger):

0 commit comments

Comments
 (0)