Skip to content

Commit 5069b67

Browse files
committed
- NoResultWarning replaced for EmptyResponseError
1 parent c62063d commit 5069b67

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

astroquery/mpc/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from ..query import BaseQuery
1717
from . import conf
1818
from ..utils import async_to_sync, class_or_instance
19-
from ..exceptions import InvalidQueryError, EmptyResponseError, NoResultsWarning
19+
from ..exceptions import InvalidQueryError, EmptyResponseError
2020

2121
__all__ = ['MPCClass']
2222

@@ -1063,7 +1063,7 @@ def _parse_result(self, result, **kwargs):
10631063
try:
10641064
i = text_table.index('\n', text_table.index('h m s')) + 1
10651065
except ValueError as e:
1066-
raise NoResultsWarning(content)
1066+
raise EmptyResponseError(content)
10671067
columns = text_table[:i]
10681068
data_start = columns.count('\n') - 1
10691069
else:
@@ -1072,7 +1072,7 @@ def _parse_result(self, result, **kwargs):
10721072
try:
10731073
i = text_table.index('\n', text_table.index('JD_TT')) + 1
10741074
except ValueError as e:
1075-
raise NoResultsWarning(content)
1075+
raise EmptyResponseError(content)
10761076
columns = text_table[:i]
10771077
data_start = columns.count('\n') - 1
10781078

astroquery/mpc/tests/test_mpc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def test_get_ephemeris_Moon_phase_and_Uncertainty(patch_post):
190190

191191

192192
def test_get_ephemeris_by_name_empty(patch_post):
193-
with pytest.raises(NoResultsWarning):
193+
with pytest.raises(EmptyResponseError):
194194
mpc.core.MPC.get_ephemeris('340P', location='G37')
195195

196196

0 commit comments

Comments
 (0)