mirror of https://github.com/celery/kombu.git
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:
parent
e0fb1f1123
commit
e3471a2fc2
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue