Skip to content

Commit 16a75be

Browse files
cclaussBethGriggs
cclauss
authored andcommitted
tools: prepare ./tools/compress_json.py for Python 3
PR-URL: #24889 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
1 parent b60808a commit 16a75be

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/compress_json.py

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
import sys
66
import zlib
77

8+
try:
9+
xrange # Python 2
10+
except NameError:
11+
xrange = range # Python 3
12+
13+
814
if __name__ == '__main__':
915
fp = open(sys.argv[1])
1016
obj = json.load(fp)

0 commit comments

Comments
 (0)