1
0
forked from VimPlug/jedi

Remove print statements and reenable the if statement scanning that allows names to get resolved in 'if 0:' clauses. Makes all tests work again.

This commit is contained in:
Dave Halter
2015-07-01 14:00:50 +02:00
parent d739828a4b
commit 80492265cf
3 changed files with 0 additions and 7 deletions

View File

@@ -206,12 +206,9 @@ class Evaluator(object):
else:
for name_dict in name_dicts:
name_dict[str(if_name)] = definitions
if len(name_dicts) > 1:
print('XXXX', len(name_dicts), if_name, definitions)
if len(name_dicts) > 1:
result = []
for name_dict in name_dicts:
print('NAME_DICT', element, name_dict)
self.predefined_if_name_dict_dict[parent] = name_dict
try:
result += self._eval_element_not_cached(element)
@@ -248,7 +245,6 @@ class Evaluator(object):
return self.eval_statement(element)
elif element.type == 'power':
types = self._eval_atom(element.children[0])
print(element, element.start_pos)
for trailer in element.children[1:]:
if trailer == '**': # has a power operation.
raise NotImplementedError

View File

@@ -87,7 +87,6 @@ class NameFinder(object):
names = self.filter_name(scopes)
if self._found_predefined_if_name is not None:
print('HAVE FOUND', self._found_predefined_if_name)
return self._found_predefined_if_name
types = self._names_to_types(names, search_global)

View File

@@ -41,12 +41,10 @@ def break_check(evaluator, base_scope, stmt, origin_scope=None):
# e.g. `if 0:` would cause all name lookup within the flow make
# unaccessible. This is not a "problem" in Python, because the code is
# never called. In Jedi though, we still want to infer types.
"""
while origin_scope is not None:
if element_scope == origin_scope:
return REACHABLE
origin_scope = origin_scope.parent
"""
x = _break_check(evaluator, stmt, base_scope, element_scope)
return x