Fix missing leading slash due to relative_to() resolution

This commit is contained in:
Łukasz Langa 2018-06-04 12:18:27 -07:00
parent 4c352ad4be
commit 75d2af2e3a

View File

@ -2826,7 +2826,7 @@ def gen_python_files_in_dir(
"""
assert root.is_absolute(), f"INTERNAL ERROR: `root` must be absolute but is {root}"
for child in path.iterdir():
normalized_path = child.resolve().relative_to(root).as_posix()
normalized_path = "/" + child.resolve().relative_to(root).as_posix()
if child.is_dir():
normalized_path += "/"
exclude_match = exclude.search(normalized_path)