Define xrange for use under Python 3

Define xrange() for Python 3. I is only used on for loops so this is safe.
This commit is contained in:
Gregory P. Smith 2018-03-12 10:24:37 -07:00 committed by GitHub
commit 89be4df26d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

5
cpplint/cpplint.py vendored
View File

@ -52,6 +52,11 @@ import string
import sys
import unicodedata
try:
xrange # Python 2
except NameError:
xrange = range # Python 3
_USAGE = """
Syntax: cpplint.py [--verbose=#] [--output=vs7] [--filter=-x,+y,...]

View File

@ -43,6 +43,11 @@ import unittest
import cpplint
try:
xrange # Python 2
except NameError:
xrange = range # Python 3
# This class works as an error collector and replaces cpplint.Error
# function for the unit tests. We also verify each category we see