1
0
forked from VimPlug/jedi

forgot some fragments of CachedModule.cache

This commit is contained in:
David Halter
2013-01-08 12:53:02 +01:00
parent 67f7e66cc6
commit 8987ecf3a8
3 changed files with 5 additions and 7 deletions

View File

@@ -376,8 +376,7 @@ class Script(object):
return None, 0 return None, 0
try: try:
timestamp, parser = builtin.CachedModule.cache[ timestamp, parser = cache.module_cache[self.source_path]
self.source_path]
except KeyError: except KeyError:
return None, 0 return None, 0
part_parser = self._module.get_part_parser() part_parser = self._module.get_part_parser()

View File

@@ -16,7 +16,6 @@ import evaluate
import helpers import helpers
import settings import settings
import debug import debug
import builtin
import imports import imports
import api_classes import api_classes
import fast_parser import fast_parser
@@ -33,7 +32,7 @@ def get_directory_modules_for_name(mods, name):
""" """
def check_python_file(path): def check_python_file(path):
try: try:
return builtin.CachedModule.cache[path][1].module return cache.module_cache[path][1].module
except KeyError: except KeyError:
try: try:
return check_fs(path) return check_fs(path)

View File

@@ -65,10 +65,10 @@ class ModuleWithCursor(Module):
""" get the parser lazy """ """ get the parser lazy """
if not self._parser: if not self._parser:
try: try:
ts, parser = builtin.CachedModule.cache[self.path] ts, parser = cache.module_cache[self.path]
cache.invalidate_star_import_cache(parser.module) cache.invalidate_star_import_cache(parser.module)
del builtin.CachedModule.cache[self.path] del cache.module_cache[self.path]
except KeyError: except KeyError:
pass pass
# Call the parser already here, because it will be used anyways. # Call the parser already here, because it will be used anyways.
@@ -77,7 +77,7 @@ class ModuleWithCursor(Module):
self._parser = fast_parser.FastParser(self.source, self.path, self._parser = fast_parser.FastParser(self.source, self.path,
self.position) self.position)
if self.path is not None: if self.path is not None:
builtin.CachedModule.cache[self.path] = time.time(), \ cache.module_cache[self.path] = time.time(), \
self._parser self._parser
return self._parser return self._parser