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:
cclauss 2018-07-23 18:00:28 +02:00 committed by Anna Henningsen
parent f42aa32529
commit bade0fedcd
No known key found for this signature in database
GPG Key ID: 9C63F3A6CD2AD8F9

5
tools/cpplint.py vendored
View File

@ -53,6 +53,11 @@ import string
import sys
import unicodedata
try:
xrange
except NameError:
xrange = range
logger = logging.getLogger('testrunner')