mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 07:14:48 +08:00
fix python2.6 issues with completing colorama. this happened because of a missing object parent class
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ from .helpers import TestCase, cwd_at
|
||||
|
||||
|
||||
class TestSetupReadline(TestCase):
|
||||
class NameSpace():
|
||||
class NameSpace(object):
|
||||
pass
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user