X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=fba%2Fconfig.py;h=1ae1a25e648a51991b1fc5b6298e7afd71b4b630;hb=b4b7a362cf34916fccecded268a717f6263c2d84;hp=dc5dd22f947fcfb4896f598243c7514d5cec3d8e;hpb=e19e1e1030189afc0138d7f83d3a411b559aa501;p=fba.git diff --git a/fba/config.py b/fba/config.py index dc5dd22..1ae1a25 100644 --- a/fba/config.py +++ b/fba/config.py @@ -17,14 +17,15 @@ import json with open("config.json") as f: + # DEBUG: print("DEBUG: Loading configuration file ...") _config = json.loads(f.read()) def get(key: str) -> any: # DEBUG: print(f"DEBUG: key[{type(key)}]={key} - CALLED!") - if type(key) != str: + if not isinstance(key, str): raise ValueError(f"Parameter key[]='{type(key)}' is not 'str'") elif key == "": - raise ValueError("Parameter 'key' cannot be empty") + raise ValueError("Parameter 'key' is empty") elif not key in _config: raise KeyError(f"key='{key}' does not exist in _config array")