Skip to content

Commit c3dda00

Browse files
cclaussMylesBorins
cclauss
authored andcommitted
tools: prepare tools/js2c.py for Python 3
PR-URL: #24798 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 7cac76c commit c3dda00

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/js2c.py

+5
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@
3737
import string
3838
import hashlib
3939

40+
try:
41+
xrange # Python 2
42+
except NameError:
43+
xrange = range # Python 3
44+
4045

4146
def ToCArray(elements, step=10):
4247
slices = (elements[i:i+step] for i in xrange(0, len(elements), step))

0 commit comments

Comments
 (0)