diff --git a/tools/js2c.py b/tools/js2c.py index e01e385afcf..e9a52047739 100755 --- a/tools/js2c.py +++ b/tools/js2c.py @@ -37,6 +37,11 @@ import sys 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))