Drop obsolete code importing pickle (#1315)

https://docs.python.org/3.9/whatsnew/3.0.html#library-changes

> A common pattern in Python 2.x is to have one version of a module implemented in pure Python, with an optional accelerated version implemented as a C extension; for example, pickle and cPickle. This places the burden of importing the accelerated version and falling back on the pure Python version on each user of these modules. In Python 3.0, the accelerated versions are considered implementation details of the pure Python versions. Users should always import the standard version, which attempts to import the accelerated version and falls back to the pure Python version. The pickle / cPickle pair received this treatment.
This commit is contained in:
Illia Volochii 2021-03-16 12:13:37 +02:00 committed by GitHub
parent e0fb1f1123
commit e3471a2fc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 7 deletions

View File

@ -2,14 +2,9 @@
import codecs
import os
import pickle
import sys
import pickle as pypickle
try:
import cPickle as cpickle
except ImportError: # pragma: no cover
cpickle = None # noqa
from collections import namedtuple
from contextlib import contextmanager
from io import BytesIO
@ -32,7 +27,6 @@ if sys.platform.startswith('java'): # pragma: no cover
else:
_decode = codecs.decode
pickle = cpickle or pypickle
pickle_load = pickle.load
#: We have to use protocol 4 until we drop support for Python 3.6 and 3.7.