Skip to content

Commit d653351

Browse files
volodymyrssbsipocz
authored andcommitted
astropy version check breaks on windows?..
1 parent bb6da21 commit d653351

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

astroquery/heasarc/core.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ def _old_w3query_fallback(self, content):
191191
f.writeto(I)
192192
I.seek(0)
193193

194-
if commons.ASTROPY_LT_5_0:
194+
try:
195195
return Table.read(I)
196-
else:
196+
except:
197197
return Table.read(I, unit_parse_strict='silent')
198198

199199
def _fallback(self, text):
@@ -225,9 +225,9 @@ def _fallback(self, text):
225225

226226
data = StringIO(text.replace(old_table, "\n".join(new_table)))
227227

228-
if commons.ASTROPY_LT_5_0:
228+
try:
229229
return Table.read(data, hdu=1)
230-
else:
230+
except:
231231
return Table.read(data, hdu=1, unit_parse_strict='silent')
232232

233233
def _parse_result(self, response, verbose=False):
@@ -250,9 +250,10 @@ def _parse_result(self, response, verbose=False):
250250
try:
251251
data = BytesIO(response.content)
252252

253-
if commons.ASTROPY_LT_5_0:
253+
# why does if commons.ASTROPY_LT_5_0 not work on Windows?
254+
try:
254255
return Table.read(data, hdu=1)
255-
else:
256+
except:
256257
return Table.read(data, hdu=1, unit_parse_strict='silent')
257258
except ValueError:
258259
try:

0 commit comments

Comments
 (0)