We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7636a66 commit 306e43dCopy full SHA for 306e43d
1 file changed
Lib/test/test_shelve.py
@@ -173,6 +173,8 @@ def test_custom_serializer_and_deserializer(self):
173
def serializer(obj, protocol):
174
if isinstance(obj, (bytes, bytearray, str)):
175
if protocol == 5:
176
+ if isinstance(obj, bytearray):
177
+ return bytes(obj)
178
return obj
179
return type(obj).__name__
180
elif isinstance(obj, array.array):
@@ -223,11 +225,10 @@ def deserializer(data):
223
225
)
224
226
227
def test_custom_incomplete_serializer_and_deserializer(self):
- dbm_sqlite3 = import_helper.import_module("dbm.sqlite3")
228
os.mkdir(self.dirname)
229
self.addCleanup(os_helper.rmtree, self.dirname)
230
- with self.assertRaises(dbm_sqlite3.error):
231
+ with self.assertRaises((TypeError, dbm.error)):
232
def serializer(obj, protocol=None):
233
pass
234
0 commit comments