From 36699b77b24db197acddc461112092354255b04a Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Tue, 13 Feb 2018 19:19:00 +0100 Subject: [PATCH] DOn't check the parser cache, that's parso's responsibility --- jedi/evaluate/context/module.py | 2 -- jedi/evaluate/imports.py | 16 +--------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/jedi/evaluate/context/module.py b/jedi/evaluate/context/module.py index cedaed63..ad12b9ef 100644 --- a/jedi/evaluate/context/module.py +++ b/jedi/evaluate/context/module.py @@ -210,5 +210,3 @@ class ModuleContext(use_metaclass(CachedMetaClass, TreeContext)): return "<%s: %s@%s-%s>" % ( self.__class__.__name__, self._string_name, self.tree_node.start_pos[0], self.tree_node.end_pos[0]) - - diff --git a/jedi/evaluate/imports.py b/jedi/evaluate/imports.py index a349647e..d0a50ac7 100644 --- a/jedi/evaluate/imports.py +++ b/jedi/evaluate/imports.py @@ -15,7 +15,6 @@ import os from parso.python import tree from parso.tree import search_ancestor -from parso.cache import parser_cache from parso import python_bytes_to_unicode from jedi._compatibility import unicode, ImplicitNSInfo, force_unicode @@ -523,19 +522,6 @@ def get_modules_containing_name(evaluator, modules, name): if file_name.endswith('.py'): yield path - def check_python_file(path): - try: - # TODO I don't think we should use the cache here?! - node_cache_item = parser_cache[evaluator.grammar._hashed][path] - except KeyError: - try: - return check_fs(path) - except IOError: - return None - else: - module_node = node_cache_item.node - return ModuleContext(evaluator, module_node, path=path) - def check_fs(path): with open(path, 'rb') as f: code = python_bytes_to_unicode(f.read(), errors='replace') @@ -570,6 +556,6 @@ def get_modules_containing_name(evaluator, modules, name): # Sort here to make issues less random. for p in sorted(paths): # make testing easier, sort it - same results on every interpreter - m = check_python_file(p) + m = check_fs(p) if m is not None and not isinstance(m, compiled.CompiledObject): yield m