1
0
forked from VimPlug/jedi

fix a few last standing issues with integration tests. ok after running tests with tox i see that they are not the last issues...

This commit is contained in:
Dave Halter
2014-01-12 00:33:13 +01:00
parent 1765fadf73
commit 4006b231d3
5 changed files with 11 additions and 7 deletions

View File

@@ -143,7 +143,7 @@ class Script(object):
if not dot:
# add named params
for call_def in self.call_signatures():
if not call_def.module.is_builtin():
if not isinstance(call_def.module, compiled.PyObject):
for p in call_def.params:
completions.append((p.get_name(), p))

View File

@@ -282,8 +282,8 @@ class Evaluator(object):
result += self.eval_call(call)
elif call == '*':
if [r for r in result if isinstance(r, iterable.Array)
or isinstance(r, er.Instance)
and str(r.name) == 'str']:
or isinstance(r, compiled.PyObject)
and isinstance(r.obj, (str, unicode))]:
# if it is an iterable, ignore * operations
next(calls_iterator)
return set(result)
@@ -452,8 +452,8 @@ def filter_private_variable(scope, call_scope, var_name):
if isinstance(var_name, (str, unicode)) and isinstance(scope, er.Instance)\
and var_name.startswith('__') and not var_name.endswith('__'):
s = call_scope.get_parent_until((pr.Class, er.Instance))
if not isinstance(scope.base, compiled.PyObject):
if s != scope and s != scope.base.base:
if s != scope and (isinstance(scope.base, compiled.PyObject)
or s != scope.base.base):
return True
return False

View File

@@ -109,6 +109,7 @@ class PyObject(Base):
for name in dir(self._cls().obj):
f = fake.get_faked(module.obj, self.obj, name)
if f:
f.parent = self
faked_subscopes.append(f)
return faked_subscopes

View File

@@ -163,9 +163,10 @@ class FakeSubModule():
class FakeStatement(pr.Statement):
def __init__(self, token_list):
def __init__(self, expression_list):
p = 0, 0
super(FakeStatement, self).__init__(FakeSubModule, token_list, p, p)
super(FakeStatement, self).__init__(FakeSubModule, expression_list, p, p)
self._expression_list = expression_list
class FakeName(pr.Name):

View File

@@ -96,6 +96,8 @@ class Array(use_metaclass(CachedMetaClass, pr.Base)):
str_key = key.value
elif isinstance(key, pr.Name):
str_key = str(key)
else:
continue
if mixed_index == str_key:
index = i