Skip to content

Commit

Permalink
tools: define xrange() in Python 3
Browse files Browse the repository at this point in the history
__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 <anna@addaleax.net>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
cclauss authored and targos committed Jul 31, 2018
1 parent 1f9570b commit ce527d9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/cpplint.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@
import sys
import unicodedata

try:
xrange
except NameError:
xrange = range


logger = logging.getLogger('testrunner')

Expand Down

0 comments on commit ce527d9

Please sign in to comment.