diff --git a/jedi/cache.py b/jedi/cache.py index 7315b79c..2930c350 100644 --- a/jedi/cache.py +++ b/jedi/cache.py @@ -33,8 +33,6 @@ from jedi import debug _time_caches = {} -_star_import_cache = {} - # for fast_parser, should not be deleted parser_cache = {} @@ -59,7 +57,6 @@ def clear_time_caches(delete_all=False): if delete_all: for cache in _time_caches.values(): cache.clear() - _star_import_cache.clear() parser_cache.clear() else: # normally just kill the expired entries, not all diff --git a/test/test_cache.py b/test/test_cache.py index 5e621ea7..087069d6 100644 --- a/test/test_cache.py +++ b/test/test_cache.py @@ -67,7 +67,9 @@ def test_star_import_cache_duration(): old, jedi.settings.star_import_cache_validity = \ jedi.settings.star_import_cache_validity, new - cache._star_import_cache = {} # first empty... + dct = cache._time_caches['star_import_cache_validity'] + old_dct = dict(dct) + dct.clear() # first empty... # path needs to be not-None (otherwise caching effects are not visible) jedi.Script('', 1, 0, '').completions() time.sleep(2 * new) @@ -75,7 +77,8 @@ def test_star_import_cache_duration(): # reset values jedi.settings.star_import_cache_validity = old - assert len(cache._star_import_cache) == 1 + assert len(dct) == 1 + dct = old_dct cache._star_import_cache = {}