Fix EarthLocation crash for astropy < 2.0
@@ -731,6 +731,12 @@ class MPCClass(BaseQuery):
request_args['c'] = '{:03d}'.format(location)
elif isinstance(location, EarthLocation):
loc = location.geodetic
+ try:
+ # astropy < 2.0
+ request_args['long'] = loc.longitude.deg
+ request_args['lat'] = loc.latitude.deg
+ except AttributeError:
+ # astropy >= 2.0
request_args['long'] = loc.lon.deg
request_args['lat'] = loc.lat.deg
request_args['alt'] = loc.height.to(u.m).value
