Skip to content

Commit

Permalink
fix: remove use of functools.cache_property for python 3.7 support
Browse files Browse the repository at this point in the history
  • Loading branch information
ManonMarchand committed Nov 10, 2023
1 parent d2d78e9 commit ff9e54b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions astroquery/simbad/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import os
from collections import namedtuple
from io import BytesIO
from functools import lru_cache, cached_property
from functools import lru_cache
import warnings
import astropy.units as u
from astropy.utils import isiterable
Expand Down Expand Up @@ -372,13 +372,16 @@ def tap(self):
self._tap = TAPService(baseurl=tap_url, session=self._session)
return self._tap

@cached_property
@property
@lru_cache(1)
def hardlimit(self):
"""The maximum number of lines for Simbad's output.
This property is cached to avoid calls to simbad's capability
page each time `query_tap` is called.
webpage each time the getter is called.
"""
# replace stack of property and lru_cache by functools.cache_property when
# astroquery drops python 3.7 support
return self.tap.hardlimit

def list_wildcards(self):
Expand Down

0 comments on commit ff9e54b

Please sign in to comment.