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 (https://github.com/nodejs/node/pull/21942). PR-URL: https://github.com/nodejs/node/pull/21945 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
f42aa32529
commit
bade0fedcd
5
tools/cpplint.py
vendored
5
tools/cpplint.py
vendored
@ -53,6 +53,11 @@ import string
|
||||
import sys
|
||||
import unicodedata
|
||||
|
||||
try:
|
||||
xrange
|
||||
except NameError:
|
||||
xrange = range
|
||||
|
||||
|
||||
logger = logging.getLogger('testrunner')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user