From 095a831c0bf83fc061554b0d81d11a45d9eed17a Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 18 Jun 2020 13:09:48 -0400 Subject: [PATCH] Fix source of abnormal console exit If using ctrl-e, c, then a delay while there is console output to do, console would crash. Fix by catching the flush problem and ignoring it. --- confluent_client/bin/confetty | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/confluent_client/bin/confetty b/confluent_client/bin/confetty index 7a54afcc..1f1f16e9 100755 --- a/confluent_client/bin/confetty +++ b/confluent_client/bin/confetty @@ -958,7 +958,13 @@ def main(): # don't bother churning if minute does not change laststate['showtime'] = now updatestatus() - sys.stdout.flush() + try: + sys.stdout.flush() + except Exception: + # EWOULDBLOCK causes this to raise, ignore + # this scenario comfortable that it + # will come out soon enough + pass else: deadline = 5 connected = False