File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -52,10 +52,12 @@ def FK4CoordGenerator(*args, **kwargs):
5252 'suppress_vo_warnings' ,
5353 'validate_email' ,
5454 'ASTROPY_LT_4_1' ,
55- 'ASTROPY_LT_4_3' ]
55+ 'ASTROPY_LT_4_3' ,
56+ 'ASTROPY_LT_5_0' ]
5657
5758ASTROPY_LT_4_1 = not minversion ('astropy' , '4.1' )
5859ASTROPY_LT_4_3 = not minversion ('astropy' , '4.3' )
60+ ASTROPY_LT_5_0 = not minversion ('astropy' , '5.0' )
5961
6062
6163@deprecated ('0.4.4' , alternative = 'astroquery.query.BaseQuery._request' )
@@ -172,7 +174,8 @@ def parse_coordinates(coordinates):
172174 "appropriate astropy.coordinates object." , InputWarning )
173175 raise u .UnitsError
174176 except ValueError as err :
175- if isinstance (err .args [1 ], u .UnitsError ):
177+ if ((ASTROPY_LT_5_0 and isinstance (err .args [1 ], u .UnitsError )) or
178+ (not ASTROPY_LT_5_0 and isinstance (err .__context__ , u .UnitsError ))):
176179 try :
177180 c = ICRSCoordGenerator (coordinates , unit = 'deg' )
178181 warnings .warn ("Coordinate string is being interpreted as an "
You can’t perform that action at this time.
0 commit comments