From e08ca5fb7e845674f83995e6f038f218e56b6274 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 14 Apr 2021 10:10:44 -0400 Subject: [PATCH] Have confetty show correct trace more easily In some scenarios, the quitconfetty will overwrite the stack trace. Get the relevant trace before trying the quitconfetty, then print the saved trace. --- confluent_client/bin/confetty | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/confluent_client/bin/confetty b/confluent_client/bin/confetty index 562acb0a..cf47648c 100755 --- a/confluent_client/bin/confetty +++ b/confluent_client/bin/confetty @@ -1024,11 +1024,12 @@ if __name__ == '__main__': errcode = e.errorcode except Exception as e: import traceback + excinfo = traceback.print_exc() try: quitconfetty() except Exception: pass - traceback.print_exc() + print(excinfo) finally: if deadline and os.times()[4] < deadline: sys.stderr.write('[Exited early, hit enter to continue]')