From 0827ddec8634ffdd161728a972914cb1a93a84af Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 6 Mar 2015 16:33:22 +0100 Subject: [PATCH] utils.log: Simplify stack printing on Qt warnings. --- qutebrowser/utils/log.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/qutebrowser/utils/log.py b/qutebrowser/utils/log.py index 0f20004eb..1ab8c2bd5 100644 --- a/qutebrowser/utils/log.py +++ b/qutebrowser/utils/log.py @@ -295,14 +295,7 @@ def qt_message_handler(msg_type, context, msg): msg += ("\n\nOn Archlinux, this should fix the problem:\n" " pacman -S libxkbcommon-x11") faulthandler.disable() - try: - frame = sys._getframe(1) # pylint: disable=protected-access - except (AttributeError, ValueError): - # sys._getframe might not exist in some Python implementations. - # It could raise ValueError if the stack is less than one level deep - - # this SHOULD never happen, but we're better safe than sorry here. - frame = None - stack = ''.join(traceback.format_stack(f=frame)) + stack = ''.join(traceback.format_stack()) record = qt.makeRecord(name, level, context.file, context.line, msg, None, None, func, sinfo=stack) qt.handle(record)