From 7c8594f88b0096bc8f2fd91e515ada1e762dda3d Mon Sep 17 00:00:00 2001 From: cclauss Date: Fri, 7 Dec 2018 10:10:55 +0100 Subject: [PATCH] tools: prepare ./tools/compress_json.py for Python 3 --- tools/compress_json.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/compress_json.py b/tools/compress_json.py index 34dbb878c48a27..b52c5d7a252cf6 100644 --- a/tools/compress_json.py +++ b/tools/compress_json.py @@ -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)