From: Ɓukasz Langa Date: Mon, 4 Jun 2018 19:18:27 +0000 (-0700) Subject: Fix missing leading slash due to `relative_to()` resolution X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/75d2af2e3a0d0cf85b1e0c510c626d1ee1938074?ds=inline Fix missing leading slash due to `relative_to()` resolution --- diff --git a/black.py b/black.py index b3b37ef..e59a1e5 100644 --- a/black.py +++ b/black.py @@ -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)