From: Tzu-ping Chung Date: Thu, 24 Oct 2019 21:19:13 +0000 (+0800) Subject: Do not crash when failing to read an entry (#1090) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/4c4a51cb6bd01e2e813354502b8327285fc00e75?hp=8ea13474a6d8dd6065d19a044477c02785424f18 Do not crash when failing to read an entry (#1090) --- diff --git a/black.py b/black.py index 24ab660..ada9b0e 100644 --- a/black.py +++ b/black.py @@ -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(