1
0
forked from VimPlug/jedi

Finally fixed all black box tests in python 2.

This commit is contained in:
Dave Halter
2016-12-03 13:37:51 +01:00
parent 2edbe44d64
commit f355c04cae
4 changed files with 28 additions and 4 deletions
+9 -1
View File
@@ -77,7 +77,7 @@ def _load_faked_module(module):
def _search_scope(scope, obj_name):
for s in scope.subscopes:
if str(s.name) == obj_name:
if s.name.value == obj_name:
return s
@@ -191,6 +191,14 @@ def _get_faked(module, obj, name=None):
def get_faked(evaluator, module, obj, name=None, parent_context=None):
if parent_context and parent_context.classdef is not None:
# Try to search in already clearly defined stuff.
found = _search_scope(parent_context.classdef, name)
if found is not None:
return found
else:
raise FakeDoesNotExist
faked, fake_module = _get_faked(module and module.obj, obj, name)
if module is not None:
module.used_names = fake_module.used_names
+2 -1
View File
@@ -1,8 +1,9 @@
def proxy(object, callback=None):
return object
class weakref():
class ref():
def __init__(self, object, callback=None):
self.__object = object
def __call__(self):
return self.__object