X-Git-Url: https://git.armaanb.net/?p=lightcards.git;a=blobdiff_plain;f=lightcards%2Fconfig.py;fp=lightcards%2Fconfig.py;h=04cfdf99627f108ccc12fafb0d0506d3c194d919;hp=2b8b93880d6707e15f958507200338b1ab211d8a;hb=2203afc601a1a16f299bb8e3691a57e45c8230fc;hpb=e5ee1f8520f9122b70466ab407e41cdd5eb83935 diff --git a/lightcards/config.py b/lightcards/config.py index 2b8b938..04cfdf9 100644 --- a/lightcards/config.py +++ b/lightcards/config.py @@ -27,8 +27,10 @@ def read_file(file): files.append(local_xdg) if os.path.exists(local): files.append(local) - if os.path.exists(file): - files.append(file) + + files.append(file) + if not os.path.exists(file): + raise ConfigException(f'"{file}": No such file or directory') from None for f in files: exec(Path(str(f)).read_text(), {}, config)