1
0
forked from VimPlug/jedi

Remove unicode usages

This commit is contained in:
Dave Halter
2020-07-02 03:26:22 +02:00
parent 5a912de937
commit 8ee0c8593e
15 changed files with 13 additions and 56 deletions

View File

@@ -1,4 +1,3 @@
from jedi._compatibility import unicode
from jedi.inference.compiled.value import CompiledValue, CompiledName, \
CompiledValueFilter, CompiledValueName, create_from_access_path
from jedi.inference.base_value import LazyValueWrapper
@@ -45,7 +44,7 @@ def create_simple_object(inference_state, obj):
Only allows creations of objects that are easily picklable across Python
versions.
"""
assert type(obj) in (int, float, str, bytes, unicode, slice, complex, bool), obj
assert type(obj) in (int, float, str, bytes, slice, complex, bool), obj
compiled_value = create_from_access_path(
inference_state,
inference_state.compiled_subprocess.create_simple_object(obj)

View File

@@ -7,10 +7,9 @@ import warnings
import re
import builtins
from jedi._compatibility import unicode
from jedi.inference.compiled.getattr_static import getattr_static
ALLOWED_GETITEM_TYPES = (str, list, tuple, unicode, bytes, bytearray, dict)
ALLOWED_GETITEM_TYPES = (str, list, tuple, bytes, bytearray, dict)
MethodDescriptorType = type(str.replace)
# These are not considered classes and access is granted even though they have
@@ -250,7 +249,7 @@ class DirectObjectAccess(object):
# Avoid some weird hacks that would just fail, because they cannot be
# used by pickle.
if not isinstance(paths, list) \
or not all(isinstance(p, (bytes, unicode)) for p in paths):
or not all(isinstance(p, str) for p in paths):
return None
return paths
@@ -383,7 +382,7 @@ class DirectObjectAccess(object):
return [self._create_access(module), access]
def get_safe_value(self):
if type(self._obj) in (bool, bytes, float, int, str, unicode, slice) or self._obj is None:
if type(self._obj) in (bool, bytes, float, int, str, slice) or self._obj is None:
return self._obj
raise ValueError("Object is type %s and not simple" % type(self._obj))