Skip to content

Commit ce527d9

Browse files
cclausstargos
cclauss
authored andcommitted
tools: define xrange() in Python 3
__xrange()__ was removed in Python 3 in favor of __range()__. This PR ensures similar functionality on both Python 2 and Python 3. Discovered via https://travis-ci.com/nodejs/node/builds/79706150 (#21942). PR-URL: #21945 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 1f9570b commit ce527d9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/cpplint.py

+5
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@
5353
import sys
5454
import unicodedata
5555

56+
try:
57+
xrange
58+
except NameError:
59+
xrange = range
60+
5661

5762
logger = logging.getLogger('testrunner')
5863

0 commit comments

Comments
 (0)