mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-19 07:14:16 +08:00
Remove force_unicode
This commit is contained in:
@@ -15,7 +15,7 @@ from functools import wraps
|
||||
import parso
|
||||
from parso.python import tree
|
||||
|
||||
from jedi._compatibility import force_unicode, cast_path, is_py3
|
||||
from jedi._compatibility import cast_path
|
||||
from jedi.parser_utils import get_executable_nodes
|
||||
from jedi import debug
|
||||
from jedi import settings
|
||||
@@ -163,9 +163,6 @@ class Script(object):
|
||||
with open(path, 'rb') as f:
|
||||
code = f.read()
|
||||
|
||||
if sys_path is not None and not is_py3:
|
||||
sys_path = list(map(force_unicode, sys_path))
|
||||
|
||||
if project is None:
|
||||
# Load the Python grammar of the current interpreter.
|
||||
project = get_default_project(
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import os
|
||||
|
||||
from jedi._compatibility import force_unicode
|
||||
from jedi.api import classes
|
||||
from jedi.api.strings import StringName, get_quote_ending
|
||||
from jedi.api.helpers import match
|
||||
@@ -94,7 +93,7 @@ def _add_strings(context, nodes, add_slash=False):
|
||||
return None
|
||||
if not first and add_slash:
|
||||
string += os.path.sep
|
||||
string += force_unicode(s)
|
||||
string += s
|
||||
first = False
|
||||
return string
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ from jedi.api.environment import get_cached_default_environment, create_environm
|
||||
from jedi.api.exceptions import WrongVersion
|
||||
from jedi.api.completion import search_in_module
|
||||
from jedi.api.helpers import split_search_string, get_module_names
|
||||
from jedi._compatibility import force_unicode
|
||||
from jedi.inference.imports import load_module_from_path, \
|
||||
load_namespace_from_path, iter_module_names
|
||||
from jedi.inference.sys_path import discover_buildout_paths
|
||||
@@ -59,10 +58,6 @@ def _remove_duplicates_from_path(path):
|
||||
yield p
|
||||
|
||||
|
||||
def _force_unicode_list(lst):
|
||||
return list(map(force_unicode, lst))
|
||||
|
||||
|
||||
class Project(object):
|
||||
"""
|
||||
Projects are a simple way to manage Python folders and define how Jedi does
|
||||
@@ -207,7 +202,7 @@ class Project(object):
|
||||
prefixed.append(self._path)
|
||||
|
||||
path = prefixed + sys_path + suffixed
|
||||
return list(_force_unicode_list(_remove_duplicates_from_path(path)))
|
||||
return list(_remove_duplicates_from_path(path))
|
||||
|
||||
def get_environment(self):
|
||||
if self._environment is None:
|
||||
|
||||
Reference in New Issue
Block a user