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>
  • Loading branch information
cclauss authored and refack committed Jan 10, 2019
1 parent ea7102a commit 36a69cc
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 @@ -37,6 +37,11 @@
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))
Expand Down

0 comments on commit 36a69cc

Please sign in to comment.