diff --git a/tools/js2c.py b/tools/js2c.py index 40f2bc6f48f483..7dd77cb29de65b 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))