mirror of
https://github.com/python/cpython.git
synced 2025-11-01 22:21:35 +00:00
bpo-34204: Use pickle.DEFAULT_PROTOCOL in shelve (GH-19639)
Use pickle.DEFAULT_PROTOCOL (currently 5) in shelve instead of a hardcoded 3.
This commit is contained in:
parent
4173320920
commit
df59273c7a
5 changed files with 29 additions and 8 deletions
|
|
@ -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 @@ def test_with(self):
|
|||
|
||||
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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue