From 683a306c515e490d167a784c821ec654333ca1ab Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 25 Nov 2014 19:51:53 +0100 Subject: [PATCH] Fix @log_signals with deleted objects. --- qutebrowser/utils/debug.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qutebrowser/utils/debug.py b/qutebrowser/utils/debug.py index 3294e4c3f..67c1b3772 100644 --- a/qutebrowser/utils/debug.py +++ b/qutebrowser/utils/debug.py @@ -53,7 +53,11 @@ def log_signals(obj): def log_slot(obj, signal, *args): """Slot connected to a signal to log it.""" dbg = dbg_signal(signal, args) - log.misc.debug("Signal in {}: {}".format(repr(obj), dbg)) + try: + r = repr(obj) + except RuntimeError: + r = '' + log.misc.debug("Signal in {}: {}".format(r, dbg)) def connect_log_slot(obj): """Helper function to connect all signals to a logging slot."""