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: #24798
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
cclauss authored and MylesBorins committed Dec 7, 2018
1 parent 7cac76c commit c3dda00
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 c3dda00

Please sign in to comment.