]> git.mxchange.org Git - fba.git/blobdiff - fba/config.py
Continued:
[fba.git] / fba / config.py
index dc5dd22f947fcfb4896f598243c7514d5cec3d8e..1ae1a25e648a51991b1fc5b6298e7afd71b4b630 100644 (file)
 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")