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 BethGriggs committed Feb 20, 2019
1 parent 5bd7e43 commit 662698d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/js2c.py
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 662698d

Please sign in to comment.