Skip to content

Commit

Permalink
tools: prepare tools/js2c.py for Python 3
Browse files Browse the repository at this point in the history
PR-URL: nodejs#24798
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
(cherry picked from commit 26b58ea)
  • Loading branch information
cclauss authored and BaochengSu committed Oct 9, 2020
1 parent df03740 commit b4ed0af
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/js2c.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
import sys
import string

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

0 comments on commit b4ed0af

Please sign in to comment.