summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_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/test/test_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/test/test_shelve.py')
-rw-r--r--Lib/test/test_shelve.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_shelve.py b/Lib/test/test_shelve.py
index ac25eee..cfdd67c 100644
--- a/Lib/test/test_shelve.py
+++ b/Lib/test/test_shelve.py
@@ -1,6 +1,8 @@
import unittest
import shelve
import glob
+import pickle
+
from test import support
from test.support import os_helper
from collections.abc import MutableMapping
@@ -160,7 +162,7 @@ class TestCase(unittest.TestCase):
def test_default_protocol(self):
with shelve.Shelf({}) as s:
- self.assertEqual(s._protocol, 3)
+ self.assertEqual(s._protocol, pickle.DEFAULT_PROTOCOL)
from test import mapping_tests