From 5f8724ac6296ff41af007203c2b35b38274b57f0 Mon Sep 17 00:00:00 2001 From: Mattijs Ugen <144798+akaIDIOT@users.noreply.github.com> Date: Tue, 23 Sep 2025 14:47:22 +0200 Subject: [PATCH] Catch FileNotFoundError instead of OSError in loadf --- confidence/io.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/confidence/io.py b/confidence/io.py index 5b28fa5..b4795a0 100644 --- a/confidence/io.py +++ b/confidence/io.py @@ -267,8 +267,8 @@ def loadf( def readf(fpath: Path) -> typing.Mapping[str, typing.Any]: try: return format.loadf(fpath) - except OSError: - # file does not exist or inaccessible + except FileNotFoundError: + # file does not exist if default is NoDefault: # no explicit default provided, continue original error raise