Skip to content

Commit 3cac039

Browse files
committed
Check decoded JSON for keys, not body
1 parent 2305048 commit 3cac039

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

geoip2/webservice.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def _exception_for_4xx_status(
141141
uri,
142142
)
143143
else:
144-
if "code" in body and "error" in body:
144+
if "code" in decoded_body and "error" in decoded_body:
145145
return self._exception_for_web_service_error(
146146
decoded_body.get("error"), decoded_body.get("code"), status, uri
147147
)

0 commit comments

Comments
 (0)