File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,6 @@ def have_python_version(py_version):
8585@support .requires_resource ('cpu' )
8686class AbstractCompatTests (pickletester .AbstractPickleTests ):
8787 py_version = None
88- _OLD_HIGHEST_PROTOCOL = pickle .HIGHEST_PROTOCOL
8988
9089 @classmethod
9190 def setUpClass (cls ):
@@ -96,14 +95,10 @@ def setUpClass(cls):
9695 # Override the default pickle protocol to match what xpickle worker
9796 # will be running.
9897 highest_protocol = highest_proto_for_py_version (cls .py_version )
99- pickletester .protocols = range (highest_protocol + 1 )
100- pickle .HIGHEST_PROTOCOL = highest_protocol
101-
102- @classmethod
103- def tearDownClass (cls ):
104- # Set the highest protocol back to the default.
105- pickle .HIGHEST_PROTOCOL = cls ._OLD_HIGHEST_PROTOCOL
106- pickletester .protocols = range (pickle .HIGHEST_PROTOCOL + 1 )
98+ cls .enterClassContext (support .swap_attr (pickletester , 'protocols' ,
99+ range (highest_protocol + 1 )))
100+ cls .enterClassContext (support .swap_attr (pickle , 'HIGHEST_PROTOCOL' ,
101+ highest_protocol ))
107102
108103 @staticmethod
109104 def send_to_worker (python , data ):
You can’t perform that action at this time.
0 commit comments