1
0
forked from VimPlug/jedi

Remove is_py3 and is_py35

This commit is contained in:
Dave Halter
2020-07-02 02:22:09 +02:00
parent 17343bb57c
commit 0cd6a8f5cc
5 changed files with 15 additions and 38 deletions

View File

@@ -18,8 +18,6 @@ from zipimport import zipimporter
from jedi.file_io import KnownContentFileIO, ZipFileIO
is_py3 = sys.version_info[0] >= 3
is_py35 = is_py3 and sys.version_info[1] >= 5
py_version = int(str(sys.version_info[0]) + str(sys.version_info[1]))
@@ -105,7 +103,7 @@ def _from_loader(loader, string):
except AttributeError:
raise ImportError("get_source was not defined on loader")
if is_py3 and f is not importlib.machinery.SourceFileLoader.get_source:
if f is not importlib.machinery.SourceFileLoader.get_source:
# Unfortunately we are reading unicode here, not bytes.
# It seems hard to get bytes, because the zip importer
# logic just unpacks the zip file and returns a file descriptor
@@ -143,7 +141,7 @@ class ImplicitNSInfo(object):
self.paths = paths
if is_py3:
if True:
all_suffixes = importlib.machinery.all_suffixes
else:
def all_suffixes():

View File

@@ -2,7 +2,7 @@ import os
import time
from contextlib import contextmanager
from jedi._compatibility import encoding, is_py3, u
from jedi._compatibility import u
_inited = False
@@ -135,9 +135,4 @@ def print_to_stdout(color, str_out):
"""
col = getattr(Fore, color)
_lazy_colorama_init()
if not is_py3:
str_out = str_out.encode(encoding, 'replace')
print(col + str_out + Fore.RESET)
# debug_function = print_to_stdout