@@ -525,7 +525,7 @@ def test_cannot_instantiate(self):
525
525
type (self .bottom_type )()
526
526
527
527
def test_pickle (self ):
528
- for proto in range (pickle .HIGHEST_PROTOCOL ):
528
+ for proto in range (pickle .HIGHEST_PROTOCOL + 1 ):
529
529
pickled = pickle .dumps (self .bottom_type , protocol = proto )
530
530
self .assertIs (self .bottom_type , pickle .loads (pickled ))
531
531
@@ -5904,7 +5904,7 @@ def test_pickle(self):
5904
5904
P_co = ParamSpec ('P_co' , covariant = True )
5905
5905
P_contra = ParamSpec ('P_contra' , contravariant = True )
5906
5906
P_default = ParamSpec ('P_default' , default = [int ])
5907
- for proto in range (pickle .HIGHEST_PROTOCOL ):
5907
+ for proto in range (pickle .HIGHEST_PROTOCOL + 1 ):
5908
5908
with self .subTest (f'Pickle protocol { proto } ' ):
5909
5909
for paramspec in (P , P_co , P_contra , P_default ):
5910
5910
z = pickle .loads (pickle .dumps (paramspec , proto ))
@@ -6327,7 +6327,7 @@ def test_typevar(self):
6327
6327
self .assertIs (StrT .__bound__ , LiteralString )
6328
6328
6329
6329
def test_pickle (self ):
6330
- for proto in range (pickle .HIGHEST_PROTOCOL ):
6330
+ for proto in range (pickle .HIGHEST_PROTOCOL + 1 ):
6331
6331
pickled = pickle .dumps (LiteralString , protocol = proto )
6332
6332
self .assertIs (LiteralString , pickle .loads (pickled ))
6333
6333
@@ -6374,7 +6374,7 @@ def return_tuple(self) -> TupleSelf:
6374
6374
return (self , self )
6375
6375
6376
6376
def test_pickle (self ):
6377
- for proto in range (pickle .HIGHEST_PROTOCOL ):
6377
+ for proto in range (pickle .HIGHEST_PROTOCOL + 1 ):
6378
6378
pickled = pickle .dumps (Self , protocol = proto )
6379
6379
self .assertIs (Self , pickle .loads (pickled ))
6380
6380
@@ -6586,7 +6586,7 @@ def test_pickle(self):
6586
6586
Ts = TypeVarTuple ('Ts' )
6587
6587
Ts_default = TypeVarTuple ('Ts_default' , default = Unpack [Tuple [int , str ]])
6588
6588
6589
- for proto in range (pickle .HIGHEST_PROTOCOL ):
6589
+ for proto in range (pickle .HIGHEST_PROTOCOL + 1 ):
6590
6590
for typevartuple in (Ts , Ts_default ):
6591
6591
z = pickle .loads (pickle .dumps (typevartuple , proto ))
6592
6592
self .assertEqual (z .__name__ , typevartuple .__name__ )
@@ -7597,7 +7597,7 @@ def test_pickle(self):
7597
7597
U_co = typing_extensions .TypeVar ('U_co' , covariant = True )
7598
7598
U_contra = typing_extensions .TypeVar ('U_contra' , contravariant = True )
7599
7599
U_default = typing_extensions .TypeVar ('U_default' , default = int )
7600
- for proto in range (pickle .HIGHEST_PROTOCOL ):
7600
+ for proto in range (pickle .HIGHEST_PROTOCOL + 1 ):
7601
7601
for typevar in (U , U_co , U_contra , U_default ):
7602
7602
z = pickle .loads (pickle .dumps (typevar , proto ))
7603
7603
self .assertEqual (z .__name__ , typevar .__name__ )
@@ -7746,7 +7746,7 @@ def test_pickle(self):
7746
7746
global U , U_infer # pickle wants to reference the class by name
7747
7747
U = typing_extensions .TypeVar ('U' )
7748
7748
U_infer = typing_extensions .TypeVar ('U_infer' , infer_variance = True )
7749
- for proto in range (pickle .HIGHEST_PROTOCOL ):
7749
+ for proto in range (pickle .HIGHEST_PROTOCOL + 1 ):
7750
7750
for typevar in (U , U_infer ):
7751
7751
z = pickle .loads (pickle .dumps (typevar , proto ))
7752
7752
self .assertEqual (z .__name__ , typevar .__name__ )
@@ -8351,7 +8351,7 @@ def test_equality(self):
8351
8351
8352
8352
def test_pickle (self ):
8353
8353
doc_info = Doc ("Who to say hi to" )
8354
- for proto in range (pickle .HIGHEST_PROTOCOL ):
8354
+ for proto in range (pickle .HIGHEST_PROTOCOL + 1 ):
8355
8355
pickled = pickle .dumps (doc_info , protocol = proto )
8356
8356
self .assertEqual (doc_info , pickle .loads (pickled ))
8357
8357
0 commit comments