Skip to content

Commit

Permalink
tools: prepare ./tools/compress_json.py for Python 3
Browse files Browse the repository at this point in the history
PR-URL: nodejs#24889
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
(cherry picked from commit ad7ddfb)
  • Loading branch information
cclauss authored and BaochengSu committed Oct 9, 2020
1 parent 7b56f61 commit a383626
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tools/compress_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
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)
Expand Down

0 comments on commit a383626

Please sign in to comment.