From c1b00ef1c1beb0db7cb7295ec0a7d127f0cedced Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sat, 10 Feb 2024 18:07:54 -0800 Subject: [PATCH] catch os.getcwd --- src/black/files.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/black/files.py b/src/black/files.py index 806152ab279..93147bce360 100644 --- a/src/black/files.py +++ b/src/black/files.py @@ -263,9 +263,9 @@ def resolves_outside_root_or_cannot_stat( Returns whether the path is a symbolic link that points outside the root directory. Also returns True if we failed to resolve the path. """ - if sys.version_info < (3, 8, 6): - path = path.absolute() # https://bugs.python.org/issue33660 try: + if sys.version_info < (3, 8, 6): + path = path.absolute() # https://bugs.python.org/issue33660 resolved_path = path.resolve() except OSError as e: if report: