From 00216907816a3f85a61a252b435c0918719f0f34 Mon Sep 17 00:00:00 2001 From: cclauss Date: Mon, 3 Dec 2018 12:00:14 +0100 Subject: [PATCH] tools: prepare tools/js2c.py for Python 3 --- tools/js2c.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/js2c.py b/tools/js2c.py index e01e385afcf75c..e9a52047739adf 100755 --- a/tools/js2c.py +++ b/tools/js2c.py @@ -37,6 +37,11 @@ import string import hashlib +try: + xrange # Python 2 +except NameError: + xrange = range # Python 3 + def ToCArray(elements, step=10): slices = (elements[i:i+step] for i in xrange(0, len(elements), step))