tools: prepare tools/js2c.py for Python 3

PR-URL: https://github.com/nodejs/node/pull/24798
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
cclauss authored and Anna Henningsen committed 2018-12-07 17:55:24 +01:00
1 parent 7468c56742
commit 26b58eabc6
1 file changed
+5
+5
View File
@@ -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))