forked from VimPlug/jedi
removed faked_scopes, was only necessary because of weakrefs.
This commit is contained in:
@@ -1,20 +1,17 @@
|
||||
memoize_caches = []
|
||||
faked_scopes = []
|
||||
|
||||
|
||||
def clear_caches():
|
||||
""" Jedi caches many things, that should be completed after each completion
|
||||
finishes.
|
||||
"""
|
||||
global memoize_caches, faked_scopes
|
||||
global memoize_caches
|
||||
|
||||
# memorize_caches must never be deleted, because the dicts will get lost in
|
||||
# the wrappers.
|
||||
for m in memoize_caches:
|
||||
m.clear()
|
||||
|
||||
faked_scopes = [] # TODO really needed anymore? weakrefs are gone...
|
||||
|
||||
|
||||
def memoize_default(default=None):
|
||||
""" This is a typical memoization decorator, BUT there is one difference:
|
||||
|
||||
@@ -255,8 +255,6 @@ class InstanceElement(use_metaclass(cache.CachedMetaClass)):
|
||||
par = InstanceElement(self.instance, origin.parent_stmt,
|
||||
self.is_class_var)
|
||||
new.parent_stmt = par
|
||||
cache.faked_scopes.append(par)
|
||||
cache.faked_scopes.append(new)
|
||||
return new
|
||||
|
||||
def __getattr__(self, name):
|
||||
@@ -370,7 +368,6 @@ class Function(use_metaclass(cache.CachedMetaClass, parsing.Base)):
|
||||
# Create param array.
|
||||
old_func = Function(f, is_decorated=True)
|
||||
params = helpers.generate_param_array([old_func], old_func)
|
||||
cache.faked_scopes.append(old_func)
|
||||
|
||||
wrappers = Execution(decorator, params).get_return_types()
|
||||
if not len(wrappers):
|
||||
@@ -519,7 +516,6 @@ class Execution(Executable):
|
||||
new_param.is_generated = True
|
||||
name = copy.copy(param.get_name())
|
||||
name.parent = new_param
|
||||
cache.faked_scopes.append(new_param)
|
||||
return name
|
||||
|
||||
result = []
|
||||
@@ -675,7 +671,6 @@ class Execution(Executable):
|
||||
if isinstance(copied, parsing.Function):
|
||||
copied = Function(copied)
|
||||
objects.append(copied)
|
||||
cache.faked_scopes.append(copied)
|
||||
return objects
|
||||
|
||||
def __getattr__(self, name):
|
||||
@@ -696,7 +691,6 @@ class Execution(Executable):
|
||||
else:
|
||||
copied = helpers.fast_parent_copy(scope)
|
||||
copied.parent = self._scope_copy(copied.parent)
|
||||
cache.faked_scopes.append(copied)
|
||||
return copied
|
||||
except AttributeError:
|
||||
raise MultiLevelAttributeError(sys.exc_info())
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import copy
|
||||
import contextlib
|
||||
|
||||
import cache
|
||||
import parsing
|
||||
import evaluate
|
||||
import debug
|
||||
@@ -196,7 +195,6 @@ def generate_param_array(args_tuple, parent_stmt=None):
|
||||
values.append([arg])
|
||||
pos = None
|
||||
arr = parsing.Array(pos, parsing.Array.TUPLE, parent_stmt, values=values)
|
||||
cache.faked_scopes.append(arr)
|
||||
return arr
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import imp
|
||||
import sys
|
||||
import time
|
||||
|
||||
import cache
|
||||
import builtin
|
||||
import modules
|
||||
import debug
|
||||
@@ -92,7 +91,6 @@ class ImportPath(parsing.Base):
|
||||
n = parsing.Name(i.namespace.names[1:], zero, zero, self.import_stmt)
|
||||
new = parsing.Import(zero, zero, n)
|
||||
new.parent = parent
|
||||
cache.faked_scopes.append(new)
|
||||
debug.dbg('Generated a nested import: %s' % new)
|
||||
return new
|
||||
|
||||
|
||||
Reference in New Issue
Block a user