diff options
| author | Zackery Spytz <zspytz@gmail.com> | 2020-10-29 03:44:35 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-29 02:44:35 -0700 |
| commit | df59273c7a384ea8c890fa8e9b80c92825df841c (patch) | |
| tree | a2d465e633a7d73df8741923d8901f0f0411f09e /Lib/shelve.py | |
| parent | 4173320920706b49a004bdddd8d7108e8984e3fc (diff) | |
| download | cpython-git-df59273c7a384ea8c890fa8e9b80c92825df841c.tar.gz | |
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.py | 4 |
1 files changed, 2 insertions, 2 deletions
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 = {} |
