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 <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
  • Loading branch information
cclauss authored and addaleax committed Dec 7, 2018
1 parent 7468c56 commit 26b58ea
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 26b58ea

Please sign in to comment.