From 0ed9e1c249eb8060d0d2cd72cdd64b30ee023bb1 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sat, 30 Dec 2017 03:40:01 +0100 Subject: [PATCH] The given sys_path gets converted to unicode now in py2 --- jedi/api/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jedi/api/__init__.py b/jedi/api/__init__.py index 1b62ee23..5459e446 100644 --- a/jedi/api/__init__.py +++ b/jedi/api/__init__.py @@ -15,6 +15,7 @@ import sys from parso.python import tree 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 import debug from jedi import settings @@ -111,6 +112,9 @@ class Script(object): cache.clear_time_caches() 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. project = Project(sys_path=sys_path) self._evaluator = Evaluator(project, environment)