Skip to content

Commit e5563ad

Browse files
committed
fix: fix import of lex and yacc depending on astropy version
these modules's location changed in astropy version 4.3
1 parent 535ddfc commit e5563ad

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

astroquery/simbad/utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
"""Contains utility functions to support legacy Simbad interface."""
22

33
from collections import deque
4+
from packaging import version
45
import re
56

7+
from astropy import __version__ as astropy_version
8+
69
from astropy.coordinates import SkyCoord, Angle
7-
from astropy.utils.parsing import lex, yacc
10+
if version.parse(astropy_version) >= version.parse("4.3"):
11+
from astropy.utils.parsing import lex, yacc
12+
else:
13+
from astropy.extern.ply import lex, yacc
814
from astropy.utils import classproperty
915

1016

0 commit comments

Comments
 (0)