1
0
forked from VimPlug/jedi

Get rid of cast_path

This commit is contained in:
Dave Halter
2021-01-14 01:39:51 +01:00
parent 2a8b212af7
commit 7555dc0d45
4 changed files with 5 additions and 29 deletions

View File

@@ -7,22 +7,6 @@ import sys
import pickle
def cast_path(string):
"""
Take a bytes or str path and cast it to unicode.
Apparently it is perfectly fine to pass both byte and unicode objects into
the sys.path. This probably means that byte paths are normal at other
places as well.
Since this just really complicates everything and Python 2.7 will be EOL
soon anyway, just go with always strings.
"""
if isinstance(string, bytes):
return str(string, encoding='UTF-8', errors='replace')
return str(string)
def pickle_load(file):
try:
return pickle.load(file)