Skip to content

Commit b4ed0af

Browse files
cclaussBaochengSu
cclauss
authored andcommittedOct 9, 2020
tools: prepare tools/js2c.py for Python 3
PR-URL: nodejs#24798 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> (cherry picked from commit 26b58ea)
1 parent df03740 commit b4ed0af

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
@@ -36,6 +36,11 @@
3636
import sys
3737
import string
3838

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.