From 9a90d48137b672fddc309dbc53dc6dd45b68dd14 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Thu, 15 Apr 2010 12:59:19 +0100 Subject: [PATCH] Wrap our dbg/err prints in an exception handler, since std.stderr is unfunctional in certain circumstances. Closes LP #562490 --- terminatorlib/util.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/terminatorlib/util.py b/terminatorlib/util.py index 8c7f8a9e..56110012 100755 --- a/terminatorlib/util.py +++ b/terminatorlib/util.py @@ -60,11 +60,17 @@ def dbg(log = ""): return if DEBUGMETHODS != [] and method not in DEBUGMETHODS: return - print >> sys.stderr, "%s::%s: %s%s" % (classname, method, log, extra) + try: + print >> sys.stderr, "%s::%s: %s%s" % (classname, method, log, extra) + except IOError: + pass def err(log = ""): """Print an error message""" - print >> sys.stderr, log + try: + print >> sys.stderr, log + except IOError: + pass def gerr(message = None): """Display a graphical error. This should only be used for serious