Skip to content

Commit dee274a

Browse files
committed
small fixes
1 parent 394c7df commit dee274a

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

ipinfo/handler.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
REQUEST_TIMEOUT_DEFAULT,
2020
BATCH_REQ_TIMEOUT_DEFAULT,
2121
cache_key,
22-
read_json_file,
2322
)
2423
from . import handler_utils
2524
from .bogon import is_bogon

ipinfo/handler_async.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
REQUEST_TIMEOUT_DEFAULT,
2424
BATCH_REQ_TIMEOUT_DEFAULT,
2525
cache_key,
26-
read_json_file,
2726
)
2827
from . import handler_utils
2928
from .bogon import is_bogon

ipinfo/handler_utils.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -97,18 +97,11 @@ def read_coords(location):
9797

9898

9999
def read_json_file(json_file):
100-
try:
101-
if not json_file:
102-
return None
103-
json_file_path = os.path.join(os.path.dirname(__file__), json_file)
104-
with open(json_file_path, encoding="utf8") as f:
105-
json_data = f.read()
106-
if not json_data:
107-
return None
108-
return json.loads(json_data)
109-
110-
except FileNotFoundError:
111-
return None
100+
json_file = os.path.join(os.path.dirname(__file__), json_file)
101+
with open(json_file, encoding="utf8") as f:
102+
json_data = f.read()
103+
104+
return json.loads(json_data)
112105

113106

114107
def return_or_fail(raise_on_fail, e, v):

0 commit comments

Comments
 (0)