From b0ac7e8e3e38c82bee4616e4bbdf905ed157e8cd Mon Sep 17 00:00:00 2001 From: banteg <4562643+banteg@users.noreply.github.com> Date: Mon, 29 Dec 2025 18:22:53 +0400 Subject: [PATCH] refactor: drop display path exception guard --- src/takopi/config.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/takopi/config.py b/src/takopi/config.py index 45c8d27..251fc25 100644 --- a/src/takopi/config.py +++ b/src/takopi/config.py @@ -17,15 +17,12 @@ _EXAMPLE_CONFIG = ( def _display_path(path: Path) -> str: - try: - cwd = Path.cwd() - if path.is_relative_to(cwd): - return f"./{path.relative_to(cwd).as_posix()}" - home = Path.home() - if path.is_relative_to(home): - return f"~/{path.relative_to(home).as_posix()}" - except Exception: - return str(path) + cwd = Path.cwd() + if path.is_relative_to(cwd): + return f"./{path.relative_to(cwd).as_posix()}" + home = Path.home() + if path.is_relative_to(home): + return f"~/{path.relative_to(home).as_posix()}" return str(path)