Skip to content

Commit aa89918

Browse files
committed
Fix missing await on resp.text() in async handlers
1 parent 3b3be43 commit aa89918

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

ipinfo/handler_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ async def getDetails(self, ip_address=None, timeout=None):
150150
if content_type == "application/json":
151151
error_response = await resp.json()
152152
else:
153-
error_response = {"error": resp.text()}
153+
error_response = {"error": await resp.text()}
154154
raise APIError(error_code, error_response)
155155
details = await resp.json()
156156

@@ -208,7 +208,7 @@ async def getResproxy(self, ip_address, timeout=None):
208208
if content_type == "application/json":
209209
error_response = await resp.json()
210210
else:
211-
error_response = {"error": resp.text()}
211+
error_response = {"error": await resp.text()}
212212
raise APIError(error_code, error_response)
213213
details = await resp.json()
214214

ipinfo/handler_core_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ async def getDetails(self, ip_address=None, timeout=None):
153153
if content_type == "application/json":
154154
error_response = await resp.json()
155155
else:
156-
error_response = {"error": resp.text()}
156+
error_response = {"error": await resp.text()}
157157
raise APIError(error_code, error_response)
158158
details = await resp.json()
159159

ipinfo/handler_lite_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ async def getDetails(self, ip_address=None, timeout=None):
141141
if content_type == "application/json":
142142
error_response = await resp.json()
143143
else:
144-
error_response = {"error": resp.text()}
144+
error_response = {"error": await resp.text()}
145145
raise APIError(error_code, error_response)
146146
details = await resp.json()
147147

ipinfo/handler_plus_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ async def getDetails(self, ip_address=None, timeout=None):
153153
if content_type == "application/json":
154154
error_response = await resp.json()
155155
else:
156-
error_response = {"error": resp.text()}
156+
error_response = {"error": await resp.text()}
157157
raise APIError(error_code, error_response)
158158
details = await resp.json()
159159

0 commit comments

Comments
 (0)