1
0
forked from VimPlug/jedi

Remove side effects when accessing jedi from the interpreter.

Note that there is http://bugs.python.org/issue31184.
Fixes #925.
This commit is contained in:
Dave Halter
2017-08-12 22:48:49 +02:00
parent b26b8a1749
commit 88cfb2cb91
4 changed files with 149 additions and 10 deletions

View File

@@ -8,6 +8,11 @@ from jedi.evaluate.compiled import mixed
from jedi.evaluate.context import Context
class NamespaceObject():
def __init__(self, dct):
self.__dict__ = dct
class MixedModuleContext(Context):
resets_positions = True
type = 'mixed_module'
@@ -16,7 +21,7 @@ class MixedModuleContext(Context):
self.evaluator = evaluator
self._namespaces = namespaces
self._namespace_objects = [type('jedi_namespace', (), n) for n in namespaces]
self._namespace_objects = [NamespaceObject(n) for n in namespaces]
self._module_context = ModuleContext(evaluator, tree_module, path=path)
self.tree_node = tree_module