1
0
forked from VimPlug/jedi

Merge branch 'master' into typeshed

There were quite a few conflicts, because there were two rewrites of the path
to dotted function.
This commit is contained in:
Dave Halter
2019-03-01 10:03:17 +01:00
12 changed files with 65 additions and 34 deletions

View File

@@ -32,7 +32,7 @@ from jedi.evaluate import imports
from jedi.evaluate import usages
from jedi.evaluate.arguments import try_iter_content
from jedi.evaluate.helpers import get_module_names, evaluate_call_of_leaf
from jedi.evaluate.sys_path import calculate_dotted_path_from_sys_path
from jedi.evaluate.sys_path import transform_path_to_dotted
from jedi.evaluate.filters import TreeNameDefinition, ParamName
from jedi.evaluate.syntax_tree import tree_name_to_contexts
from jedi.evaluate.context import ModuleContext
@@ -108,7 +108,6 @@ class Script(object):
self._evaluator = Evaluator(
project, environment=environment, script_path=self.path
)
self._project = project
debug.speed('init')
self._module_node, source = self._evaluator.parse_and_get_code(
code=source,
@@ -149,10 +148,7 @@ class Script(object):
def _get_module(self):
names = ('__main__',)
if self.path is not None:
import_names = calculate_dotted_path_from_sys_path(
self._evaluator.get_sys_path(),
self.path
)
import_names = transform_path_to_dotted(self._evaluator.get_sys_path(), self.path)
if import_names is not None:
names = import_names