From 75d2af2e3a0d0cf85b1e0c510c626d1ee1938074 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Langa?= Date: Mon, 4 Jun 2018 12:18:27 -0700 Subject: [PATCH] Fix missing leading slash due to `relative_to()` resolution --- black.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.39.5