From 72f82e0ace184fe862f1b19c4f71c3bc36cf335b Mon Sep 17 00:00:00 2001 From: Reid 'arrdem' McKenzie Date: Sat, 26 Nov 2022 14:17:20 -0700 Subject: [PATCH] Do debug printing in JSON since pprint is nonsense --- zapp/compiler/__main__.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/zapp/compiler/__main__.py b/zapp/compiler/__main__.py index 3a236de..d563b4a 100644 --- a/zapp/compiler/__main__.py +++ b/zapp/compiler/__main__.py @@ -12,7 +12,6 @@ import zipfile from email.parser import Parser from itertools import chain from pathlib import Path -from pprint import pprint from tempfile import TemporaryDirectory from zapp.support.pep425 import compress_tags, decompress_tag @@ -216,9 +215,9 @@ def rezip_wheels(opts, manifest): pass wf = str(wf) else: - if opts.debug: - print("---") - pprint({"$type": "whl", **w}) + if opts.debug and False: + print("\n---") + json.dump({"$type": "whl", **w}, sys.stdout, indent=2) wf = zip_wheel(opts.tmpdir, w) @@ -330,15 +329,17 @@ def main(): manifest = insert_manifest_json(opts, manifest) if opts.debug: - print("---") - pprint( + print("\n---") + json.dump( { "$type": "zapp", "opts": { k: getattr(opts, k) for k in dir(opts) if not k.startswith("_") }, "manifest": manifest, - } + }, + sys.stdout, + indent=2 ) with open(opts.output, "w") as zapp: