From df59273c7a384ea8c890fa8e9b80c92825df841c Mon Sep 17 00:00:00 2001 From: Zackery Spytz Date: Thu, 29 Oct 2020 03:44:35 -0600 Subject: bpo-34204: Use pickle.DEFAULT_PROTOCOL in shelve (GH-19639) Use pickle.DEFAULT_PROTOCOL (currently 5) in shelve instead of a hardcoded 3. --- Lib/shelve.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Lib/shelve.py') diff --git a/Lib/shelve.py b/Lib/shelve.py index 5d443a0fa8..e053c39734 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 = {} -- cgit v1.2.1