@@ -2781,29 +2781,30 @@ def test_clear_pickler_memo(self):
27812781 # object again, the third serialized form should be identical to the
27822782 # first one we obtained.
27832783 data = ["abcdefg" , "abcdefg" , 44 ]
2784- f = io .BytesIO ()
2785- pickler = self .pickler_class (f )
2784+ for proto in protocols :
2785+ f = io .BytesIO ()
2786+ pickler = self .pickler_class (f , proto )
27862787
2787- pickler .dump (data )
2788- first_pickled = f .getvalue ()
2788+ pickler .dump (data )
2789+ first_pickled = f .getvalue ()
27892790
2790- # Reset BytesIO object.
2791- f .seek (0 )
2792- f .truncate ()
2791+ # Reset BytesIO object.
2792+ f .seek (0 )
2793+ f .truncate ()
27932794
2794- pickler .dump (data )
2795- second_pickled = f .getvalue ()
2795+ pickler .dump (data )
2796+ second_pickled = f .getvalue ()
27962797
2797- # Reset the Pickler and BytesIO objects.
2798- pickler .clear_memo ()
2799- f .seek (0 )
2800- f .truncate ()
2798+ # Reset the Pickler and BytesIO objects.
2799+ pickler .clear_memo ()
2800+ f .seek (0 )
2801+ f .truncate ()
28012802
2802- pickler .dump (data )
2803- third_pickled = f .getvalue ()
2803+ pickler .dump (data )
2804+ third_pickled = f .getvalue ()
28042805
2805- self .assertNotEqual (first_pickled , second_pickled )
2806- self .assertEqual (first_pickled , third_pickled )
2806+ self .assertNotEqual (first_pickled , second_pickled )
2807+ self .assertEqual (first_pickled , third_pickled )
28072808
28082809 def test_priming_pickler_memo (self ):
28092810 # Verify that we can set the Pickler's memo attribute.
0 commit comments