mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
The given sys_path gets converted to unicode now in py2
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user