1
0
forked from VimPlug/jedi

use GlobalNamespace differently

This commit is contained in:
David Halter
2013-10-07 23:50:27 +04:30
parent ea25b1489a
commit 4ea5f370eb
2 changed files with 4 additions and 4 deletions

View File

@@ -377,7 +377,7 @@ class Script(object):
scopes |= keywords.keywords(string=goto_path, pos=self._pos)
d = set([api_classes.Definition(s) for s in scopes
if not isinstance(s, imports.ImportPath._GlobalNamespace)])
if s is not imports.ImportPath.GlobalNamespace])
return self._sorted_defs(d)
@api_classes._clear_caches_after_call
@@ -392,7 +392,7 @@ class Script(object):
"""
results, _ = self._goto()
d = [api_classes.Definition(d) for d in set(results)
if not isinstance(d, imports.ImportPath._GlobalNamespace)]
if d is not imports.ImportPath.GlobalNamespace]
return self._sorted_defs(d)
def _goto(self, add_import_name=False):

View File

@@ -39,11 +39,11 @@ class ImportPath(pr.Base):
"""
An ImportPath is the path of a `pr.Import` object.
"""
class _GlobalNamespace(object):
class GlobalNamespace(object):
def __init__(self):
self.line_offset = 0
GlobalNamespace = _GlobalNamespace()
GlobalNamespace = GlobalNamespace()
def __init__(self, import_stmt, is_like_search=False, kill_count=0,
direct_resolve=False, is_just_from=False):