From 305d7d93122e1802b2ef840805309627b1f38e6e Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Thu, 10 Apr 2014 19:09:01 +0000 Subject: [PATCH] Make exception logging failures more robust * lib/mudpy/misc.py(excepthook): When an uncaught exception is raised and the attempt to log it fails, try to write it to stdout directly and also mention the new exception details. --- lib/mudpy/misc.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/mudpy/misc.py b/lib/mudpy/misc.py index 9e6dd99..02db563 100644 --- a/lib/mudpy/misc.py +++ b/lib/mudpy/misc.py @@ -2463,14 +2463,9 @@ def excepthook(excepttype, value, tracebackdata): # try to log it, if possible try: log(message, 9) - except: - pass - - # try to write it to stderr, if possible - try: - sys.stderr.write(message) - except: - pass + except Exception as e: + # try to write it to stderr, if possible + sys.stderr.write(message + "\nException while logging...\n%s" % e) def sighook(what, where): -- 2.11.0