mirror of
https://github.com/davidhalter/jedi.git
synced 2026-01-31 00:55:22 +08:00
fix IndexErrors which sometimes happened, related to inter-module param searching
This commit is contained in:
@@ -127,9 +127,11 @@ class CachedMetaClass(type):
|
||||
|
||||
class Executable(parsing.Base):
|
||||
""" An instance is also an executable - because __init__ is called """
|
||||
def __init__(self, base, var_args=parsing.Array(None, None)):
|
||||
def __init__(self, base, var_args=None):
|
||||
self.base = base
|
||||
# The param input array.
|
||||
if var_args is None:
|
||||
var_args = parsing.Array(None, None)
|
||||
self.var_args = var_args
|
||||
|
||||
def get_parent_until(self, *args, **kwargs):
|
||||
@@ -141,7 +143,7 @@ class Executable(parsing.Base):
|
||||
|
||||
class Instance(use_metaclass(CachedMetaClass, Executable)):
|
||||
""" This class is used to evaluate instances. """
|
||||
def __init__(self, base, var_args=parsing.Array(None, None)):
|
||||
def __init__(self, base, var_args=None):
|
||||
super(Instance, self).__init__(base, var_args)
|
||||
if str(base.name) in ['list', 'set'] \
|
||||
and builtin.builtin_scope == base.get_parent_until():
|
||||
|
||||
@@ -422,7 +422,8 @@ class Flow(Scope):
|
||||
else:
|
||||
self.set_vars = set_vars
|
||||
for s in self.set_vars:
|
||||
s.parent().parent = weakref.ref(self)
|
||||
s.parent().parent = lambda: self
|
||||
s.parent = weakref.ref(self)
|
||||
|
||||
@property
|
||||
def parent(self):
|
||||
@@ -1601,6 +1602,7 @@ class PyFuzzyParser(object):
|
||||
self.freshscope = True
|
||||
while True:
|
||||
try:
|
||||
self.module.temp_used_names = []
|
||||
token_type, tok = self.next()
|
||||
#debug.dbg('main: tok=[%s] type=[%s] indent=[%s]'\
|
||||
# % (tok, tokenize.tok_name[token_type], start_position[0]))
|
||||
|
||||
Reference in New Issue
Block a user