From ce527d973a72181dbf9639d13ac10a5fd2d013f5 Mon Sep 17 00:00:00 2001 From: cclauss Date: Mon, 23 Jul 2018 18:00:28 +0200 Subject: [PATCH] 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 Reviewed-By: Tiancheng "Timothy" Gu Reviewed-By: James M Snell --- tools/cpplint.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/cpplint.py b/tools/cpplint.py index a4f786f01a941f..a0f67a4ca8bc49 100644 --- a/tools/cpplint.py +++ b/tools/cpplint.py @@ -53,6 +53,11 @@ import sys import unicodedata +try: + xrange +except NameError: + xrange = range + logger = logging.getLogger('testrunner')