Skip to content

Commit 105ed0e

Browse files
committed
fix: allow local auth to not exist
1 parent 0743a80 commit 105ed0e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

tests/util/keyhandler.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,12 @@ def _decrypt_dict(data: dict) -> dict:
5353

5454

5555
__fp__ = Path(__file__).parent
56-
_auth = _decrypt_dict(tomllib.load(
57-
(__fp__ / "auth.toml").open("rb")
58-
))
59-
_local_auth = tomllib.load(
60-
(__fp__ / "localauth.toml").open("rb")
61-
)
56+
57+
_auth_fp = __fp__ / "auth.toml"
58+
_local_auth_fp = __fp__ / "local_auth.toml"
59+
60+
_auth = _decrypt_dict(tomllib.load(_auth_fp.open("rb")))
61+
62+
_local_auth = tomllib.load(_local_auth_fp.open("rb")) if _local_auth_fp.exists() else {}
6263

6364
AUTH = _auth | _local_auth

0 commit comments

Comments
 (0)