summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorcclauss <cclauss@bluewin.ch>2018-12-07 10:10:55 +0100
committerRich Trott <rtrott@gmail.com>2018-12-10 19:46:50 -0800
commitad7ddfbca1a07d743dfbfbfc6c2ca748c9e77cbe (patch)
tree11412ed04810704a19237317f02e2ecf6b6315c9 /tools
parent59065308349b7cb8d93439324afc00b7c51fecdf (diff)
downloadandroid-node-v8-ad7ddfbca1a07d743dfbfbfc6c2ca748c9e77cbe.tar.gz
android-node-v8-ad7ddfbca1a07d743dfbfbfc6c2ca748c9e77cbe.tar.bz2
android-node-v8-ad7ddfbca1a07d743dfbfbfc6c2ca748c9e77cbe.zip
tools: prepare ./tools/compress_json.py for Python 3
PR-URL: https://github.com/nodejs/node/pull/24889 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/compress_json.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/compress_json.py b/tools/compress_json.py
index 34dbb878c4..b52c5d7a25 100644
--- a/tools/compress_json.py
+++ b/tools/compress_json.py
@@ -5,6 +5,12 @@ import struct
import sys
import zlib
+try:
+ xrange # Python 2
+except NameError:
+ xrange = range # Python 3
+
+
if __name__ == '__main__':
fp = open(sys.argv[1])
obj = json.load(fp)