@@ -25,7 +25,7 @@ class StringReadError(Exception):
25
25
pass
26
26
27
27
28
- def readfromjson (filename : str ) -> Dict [str , str ]:
28
+ def readfromjson (filename : str ) -> dict [str , str ]:
29
29
"""Reads a JSON file and returns a dictionary."""
30
30
try :
31
31
with open (filename , encoding = "utf-8" ) as jsondata :
@@ -36,7 +36,7 @@ def readfromjson(filename: str) -> Dict[str, str]:
36
36
raise JSONReadError ("Invalid JSON File" )
37
37
38
38
39
- def readfromurl (url : str , params : Optional [ Dict [ str , str ]] = None ) -> Dict [str , str ]:
39
+ def readfromurl (url : str , params : dict [ str , str ] | None = None ) -> dict [str , str ]:
40
40
"""Loads JSON data from a URL and returns a dictionary."""
41
41
http = urllib3 .PoolManager ()
42
42
response = http .request ("GET" , url , fields = params )
@@ -45,7 +45,7 @@ def readfromurl(url: str, params: Optional[Dict[str, str]] = None) -> Dict[str,
45
45
raise URLReadError ("URL is not returning correct response" )
46
46
47
47
48
- def readfromstring (jsondata : str ) -> Dict [str , str ]:
48
+ def readfromstring (jsondata : str ) -> dict [str , str ]:
49
49
"""Loads JSON data from a string and returns a dictionary."""
50
50
if not isinstance (jsondata , str ):
51
51
raise StringReadError ("Input is not a proper JSON string" )
0 commit comments