1
0
forked from VimPlug/jedi

fix python2.6 issues with completing colorama. this happened because of a missing object parent class

This commit is contained in:
Dave Halter
2014-01-22 17:14:28 +01:00
parent c7cae7900b
commit c8fffbd7b6
2 changed files with 5 additions and 6 deletions

View File

@@ -588,7 +588,7 @@ class Interpreter(Script):
if isinstance(user_stmt, pr.Import) or not is_simple_path: if isinstance(user_stmt, pr.Import) or not is_simple_path:
return super(type(self), self)._simple_complete(path, like) return super(type(self), self)._simple_complete(path, like)
else: else:
class NamespaceModule: class NamespaceModule(object):
def __getattr__(_, name): def __getattr__(_, name):
for n in self.namespaces: for n in self.namespaces:
try: try:
@@ -613,12 +613,11 @@ class Interpreter(Script):
pass pass
completions = [] completions = []
for n in namespaces: for namespace in namespaces:
for name in dir(n): for name in dir(namespace):
if name.lower().startswith(like.lower()): if name.lower().startswith(like.lower()):
scope = self._parser.module() scope = self._parser.module()
n = pr.Name(self._parser.module(), [(name, (0, 0))], n = helpers.FakeName(name, scope)
(0, 0), (0, 0), scope)
completions.append((n, scope)) completions.append((n, scope))
return completions return completions

View File

@@ -5,7 +5,7 @@ from .helpers import TestCase, cwd_at
class TestSetupReadline(TestCase): class TestSetupReadline(TestCase):
class NameSpace(): class NameSpace(object):
pass pass
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):