mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +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
6a72d52a67
commit
0b7d271b09
|
|
@ -37,6 +37,11 @@ import sys
|
||||||
import string
|
import string
|
||||||
import hashlib
|
import hashlib
|
||||||
|
|
||||||
|
try:
|
||||||
|
xrange # Python 2
|
||||||
|
except NameError:
|
||||||
|
xrange = range # Python 3
|
||||||
|
|
||||||
|
|
||||||
def ToCArray(elements, step=10):
|
def ToCArray(elements, step=10):
|
||||||
slices = (elements[i:i+step] for i in xrange(0, len(elements), step))
|
slices = (elements[i:i+step] for i in xrange(0, len(elements), step))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user