Fixed __file__ issues by always applying a ModuleWrapper in the global scope lookup.

This commit is contained in:
Dave Halter
2014-07-01 15:35:21 +02:00
parent 8d63e6f6e7
commit 3865c1a844
2 changed files with 7 additions and 10 deletions

View File

@@ -205,11 +205,9 @@ class Script(object):
scopes = list(self._prepare_goto(path, True))
except NotFoundError:
scopes = []
scope = self._parser.user_scope()
if isinstance(scope, pr.Module) \
and not isinstance(scope, interpreter.InterpreterNamespace):
scope = er.ModuleWrapper(self._evaluator, scope)
scope_names_generator = get_names_of_scope(self._evaluator, scope, self._pos)
scope_names_generator = get_names_of_scope(self._evaluator,
self._parser.user_scope(),
self._pos)
completions = []
for scope, name_list in scope_names_generator:
for c in name_list:
@@ -288,11 +286,7 @@ class Script(object):
stmt.start_pos = self._pos
else:
stmt.start_pos = user_stmt.start_pos
scope = self._parser.user_scope()
if isinstance(scope, pr.Module) \
and not isinstance(scope, interpreter.InterpreterNamespace):
scope = er.ModuleWrapper(self._evaluator, scope)
stmt.parent = scope
stmt.parent = self._parser.user_scope()
return stmt
def complete(self):