mirror of
https://github.com/tiennm99/styleguide.git
synced 2026-08-13 08:23:06 +00:00
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:
Vendored
+5
@@ -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,...]
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user