Commit 4c4a51cb authored by Tzu-ping Chung's avatar Tzu-ping Chung Committed by Jelle Zijlstra
Browse files

Do not crash when failing to read an entry (#1090)

parent 8ea13474
Loading
Loading
Loading
Loading
+3 −0
Changes for black.py: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -3491,6 +3491,9 @@ def gen_python_files_in_dir(
        # Then ignore with `exclude` option.
        try:
            normalized_path = "/" + child.resolve().relative_to(root).as_posix()
        except OSError as e:
            report.path_ignored(child, f"cannot be read because {e}")
            continue
        except ValueError:
            if child.is_symlink():
                report.path_ignored(