summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIllia Volochii <illia.volochii@gmail.com>2021-03-16 12:13:37 +0200
committerGitHub <noreply@github.com>2021-03-16 12:13:37 +0200
commite3471a2fc2e3029d125b13f8ebb9299c70a19cba (patch)
treeacc6233d13cf396ae27d896fca5577d39484eced
parente0fb1f1123ede962cbbdf2075a1a9a2d0a086cf6 (diff)
downloadkombu-e3471a2fc2e3029d125b13f8ebb9299c70a19cba.tar.gz
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.
-rw-r--r--kombu/serialization.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/kombu/serialization.py b/kombu/serialization.py
index d7034a29..ed7bb315 100644
--- a/kombu/serialization.py
+++ b/kombu/serialization.py
@@ -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.