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
2 changed files with 10 additions and 0 deletions
+5
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,...]
+5
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