The given sys_path gets converted to unicode now in py2

This commit is contained in:
Dave Halter
2017-12-30 03:40:01 +01:00
parent f17afc6519
commit 0ed9e1c249

View File

@@ -15,6 +15,7 @@ import sys
from parso.python import tree from parso.python import tree
from parso import python_bytes_to_unicode, split_lines from parso import python_bytes_to_unicode, split_lines
from jedi._compatibility import force_unicode, is_py3
from jedi.parser_utils import get_executable_nodes from jedi.parser_utils import get_executable_nodes
from jedi import debug from jedi import debug
from jedi import settings from jedi import settings
@@ -111,6 +112,9 @@ class Script(object):
cache.clear_time_caches() cache.clear_time_caches()
debug.reset_time() debug.reset_time()
if sys_path is not None and not is_py3:
sys_path = list(map(force_unicode, sys_path))
# Load the Python grammar of the current interpreter. # Load the Python grammar of the current interpreter.
project = Project(sys_path=sys_path) project = Project(sys_path=sys_path)
self._evaluator = Evaluator(project, environment) self._evaluator = Evaluator(project, environment)