0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 15:06:33 +01:00

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 2018-12-03 12:00:14 +01:00 committed by Anna Henningsen
parent 7468c56742
commit 26b58eabc6
No known key found for this signature in database
GPG Key ID: 9C63F3A6CD2AD8F9

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))