diff options
author | cclauss <cclauss@bluewin.ch> | 2018-12-03 12:00:14 +0100 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2018-12-07 17:55:24 +0100 |
commit | 26b58eabc6348ff12047cc2f7575f5b10cd3f317 (patch) | |
tree | 5f884da5db9577e15f92b38273f39b4c767de81e /tools/js2c.py | |
parent | 7468c56742a726e18b0b6583d0ce9c6b50f2bce0 (diff) | |
download | android-node-v8-26b58eabc6348ff12047cc2f7575f5b10cd3f317.tar.gz android-node-v8-26b58eabc6348ff12047cc2f7575f5b10cd3f317.tar.bz2 android-node-v8-26b58eabc6348ff12047cc2f7575f5b10cd3f317.zip |
tools: prepare tools/js2c.py for Python 3
PR-URL: https://github.com/nodejs/node/pull/24798
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'tools/js2c.py')
-rwxr-xr-x | tools/js2c.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/js2c.py b/tools/js2c.py index e01e385afc..e9a5204773 100755 --- a/tools/js2c.py +++ b/tools/js2c.py @@ -37,6 +37,11 @@ import sys 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)) |