diff --git a/jedi/api/__init__.py b/jedi/api/__init__.py index 6c1dfb66..f8e854f1 100644 --- a/jedi/api/__init__.py +++ b/jedi/api/__init__.py @@ -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 diff --git a/test/test_utils.py b/test/test_utils.py index e13a1947..737c00a2 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -5,7 +5,7 @@ from .helpers import TestCase, cwd_at class TestSetupReadline(TestCase): - class NameSpace(): + class NameSpace(object): pass def __init__(self, *args, **kwargs):