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

View File

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