File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -639,18 +639,11 @@ def test_no_fields(self):
639
639
640
640
def test_pickling (self ):
641
641
import pickle
642
- mods = [pickle ]
643
- try :
644
- import cPickle
645
- mods .append (cPickle )
646
- except ImportError :
647
- pass
648
- protocols = [0 , 1 , 2 ]
649
- for mod in mods :
650
- for protocol in protocols :
651
- for ast in (compile (i , "?" , "exec" , 0x400 ) for i in exec_tests ):
652
- ast2 = mod .loads (mod .dumps (ast , protocol ))
653
- self .assertEqual (to_tuple (ast2 ), to_tuple (ast ))
642
+
643
+ for protocol in range (pickle .HIGHEST_PROTOCOL + 1 ):
644
+ for ast in (compile (i , "?" , "exec" , 0x400 ) for i in exec_tests ):
645
+ ast2 = pickle .loads (pickle .dumps (ast , protocol ))
646
+ self .assertEqual (to_tuple (ast2 ), to_tuple (ast ))
654
647
655
648
def test_invalid_sum (self ):
656
649
pos = dict (lineno = 2 , col_offset = 3 )
You can’t perform that action at this time.
0 commit comments