33
44import six
55from six .moves import cPickle as pickle
6- from six .moves import xrange
6+ from six .moves import range
77
88from io import BytesIO
99
@@ -104,7 +104,7 @@ def test_simple():
104104 pickle .dump (ax , BytesIO (), pickle .HIGHEST_PROTOCOL )
105105
106106 ax = plt .axes (projection = 'polar' )
107- plt .plot (list ( xrange ( 10 ) ), label = 'foobar' )
107+ plt .plot (np . arange ( 10 ), label = 'foobar' )
108108 plt .legend ()
109109
110110 # Uncomment to debug any unpicklable objects. This is slow so is not
@@ -117,12 +117,12 @@ def test_simple():
117117# pickle.dump(ax, BytesIO(), pickle.HIGHEST_PROTOCOL)
118118
119119 plt .figure ()
120- plt .bar (left = list ( xrange ( 10 )) , height = list ( xrange ( 10 ) ))
120+ plt .bar (left = np . arange ( 10 ), height = np . arange ( 10 ))
121121 pickle .dump (plt .gca (), BytesIO (), pickle .HIGHEST_PROTOCOL )
122122
123123 fig = plt .figure ()
124124 ax = plt .axes ()
125- plt .plot (list ( xrange ( 10 ) ))
125+ plt .plot (np . arange ( 10 ))
126126 ax .set_yscale ('log' )
127127 pickle .dump (fig , BytesIO (), pickle .HIGHEST_PROTOCOL )
128128
@@ -140,7 +140,7 @@ def test_complete():
140140 v = np .sin (v * - 0.6 )
141141
142142 plt .subplot (3 , 3 , 1 )
143- plt .plot (list (xrange (10 )))
143+ plt .plot (list (range (10 ))) # Ensure lists also pickle correctly.
144144
145145 plt .subplot (3 , 3 , 2 )
146146 plt .contourf (data , hatches = ['//' , 'ooo' ])
0 commit comments