summaryrefslogtreecommitdiffstats
path: root/Lib/shelve.py
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2020-10-29 09:44:35 (GMT)
committerGitHub <noreply@github.com>2020-10-29 09:44:35 (GMT)
commitdf59273c7a384ea8c890fa8e9b80c92825df841c (patch)
treea2d465e633a7d73df8741923d8901f0f0411f09e /Lib/shelve.py
parent4173320920706b49a004bdddd8d7108e8984e3fc (diff)
downloadcpython-df59273c7a384ea8c890fa8e9b80c92825df841c.zip
cpython-df59273c7a384ea8c890fa8e9b80c92825df841c.tar.gz
cpython-df59273c7a384ea8c890fa8e9b80c92825df841c.tar.bz2
bpo-34204: Use pickle.DEFAULT_PROTOCOL in shelve (GH-19639)
Use pickle.DEFAULT_PROTOCOL (currently 5) in shelve instead of a hardcoded 3.
Diffstat (limited to 'Lib/shelve.py')
-rw-r--r--Lib/shelve.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/shelve.py b/Lib/shelve.py
index 5d443a0..e053c39 100644
--- a/Lib/shelve.py
+++ b/Lib/shelve.py
@@ -56,7 +56,7 @@ entries in the cache, and empty the cache (d.sync() also synchronizes
the persistent dictionary on disk, if feasible).
"""
-from pickle import Pickler, Unpickler
+from pickle import DEFAULT_PROTOCOL, Pickler, Unpickler
from io import BytesIO
import collections.abc
@@ -85,7 +85,7 @@ class Shelf(collections.abc.MutableMapping):
keyencoding="utf-8"):
self.dict = dict
if protocol is None:
- protocol = 3
+ protocol = DEFAULT_PROTOCOL
self._protocol = protocol
self.writeback = writeback
self.cache = {}