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:
parent
7468c56742
commit
26b58eabc6
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user