utils.log: Simplify stack printing on Qt warnings.
This commit is contained in:
parent
3e5b9a4a4a
commit
0827ddec86
@ -295,14 +295,7 @@ def qt_message_handler(msg_type, context, msg):
|
|||||||
msg += ("\n\nOn Archlinux, this should fix the problem:\n"
|
msg += ("\n\nOn Archlinux, this should fix the problem:\n"
|
||||||
" pacman -S libxkbcommon-x11")
|
" pacman -S libxkbcommon-x11")
|
||||||
faulthandler.disable()
|
faulthandler.disable()
|
||||||
try:
|
stack = ''.join(traceback.format_stack())
|
||||||
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))
|
|
||||||
record = qt.makeRecord(name, level, context.file, context.line, msg, None,
|
record = qt.makeRecord(name, level, context.file, context.line, msg, None,
|
||||||
None, func, sinfo=stack)
|
None, func, sinfo=stack)
|
||||||
qt.handle(record)
|
qt.handle(record)
|
||||||
|
Loading…
Reference in New Issue
Block a user