There was an error while loading. Please reload this page.
1 parent f216c94 commit 6285ffdCopy full SHA for 6285ffd
1 file changed
Lib/test/pickletester.py
@@ -888,9 +888,16 @@ def __reduce__(self):
888
# 5th item is not an iterator
889
return dict, (), None, None, []
890
891
+ # Protocol 0 is less strict and also accept iterables.
892
for proto in protocols:
- self.assertRaises(pickle.PickleError, self.dumps, C(), proto)
893
- self.assertRaises(pickle.PickleError, self.dumps, D(), proto)
+ try:
894
+ self.dumps(C(), proto)
895
+ except (pickle.PickleError):
896
+ pass
897
898
+ self.dumps(D(), proto)
899
900
901
902
# Test classes for reduce_ex
903
0 commit comments