Skip to content

Commit f8d5bfc

Browse files
committed
Making sure we only raise_for_response for Response objects
1 parent ec02429 commit f8d5bfc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

astroquery/utils/process_asyncs.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"""
55
import textwrap
66
import functools
7+
from requests import Response
8+
79
from .class_or_instance import class_or_instance
810
from .docstr_chompers import remove_sections
911

@@ -26,7 +28,10 @@ def newmethod(self, *args, **kwargs):
2628
response = getattr(self, async_method_name)(*args, **kwargs)
2729
if kwargs.get('get_query_payload') or kwargs.get('field_help'):
2830
return response
29-
response.raise_for_status()
31+
# mast is doing something weird by stacking the responses into a list while also using async_to_sync
32+
# so we have to check for that here until it's refactored
33+
if isinstance(response, Response):
34+
response.raise_for_status()
3035
result = self._parse_result(response, verbose=verbose)
3136
self.table = result
3237
return result

0 commit comments

Comments
 (0)