Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d4700d0

Browse files
authored
Convert xrange() to itertools.count()
Import itertools and use itertools.count() to convert xrange() for Python3
1 parent 443653a commit d4700d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/sphinxext/plot_directive.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
import six
137137
from six.moves import xrange
138138

139-
import sys, os, shutil, io, re, textwrap
139+
import sys, os, shutil, io, re, textwrap, itertools
140140
from os.path import relpath
141141
import traceback
142142
import warnings
@@ -597,7 +597,7 @@ def render_figures(code, code_path, output_dir, output_base, context,
597597
all_exists = True
598598
for i, code_piece in enumerate(code_pieces):
599599
images = []
600-
for j in xrange(1000):
600+
for j in itertools.count(0):
601601
if len(code_pieces) > 1:
602602
img = ImageFile('%s_%02d_%02d' % (output_base, i, j), output_dir)
603603
else:

0 commit comments

Comments
 (0)