srcscanner.py replace windows slashes

This commit is contained in:
Daniel Agar
2016-05-11 18:51:39 +02:00
committed by Lorenz Meier
parent 8e130c878c
commit 194b48b50a
+2 -1
View File
@@ -34,7 +34,8 @@ class SourceScanner(object):
parser.Parse method.
"""
prefix = ".." + os.path.sep + "src" + os.path.sep
scope = re.sub(prefix, '', os.path.dirname(os.path.relpath(path)))
scope = re.sub(prefix.replace("\\", "/"), "", os.path.dirname(os.path.relpath(path)).replace("\\", "/"))
with codecs.open(path, 'r', 'utf-8') as f:
try:
contents = f.read()