Clean up faulthandler import

This commit is contained in:
Florian Bruhin 2014-11-09 22:59:14 +01:00
parent 5f9c56bcdd
commit 404e425a9e

View File

@ -26,6 +26,7 @@ import html as pyhtml
import logging import logging
import contextlib import contextlib
import collections import collections
import faulthandler
from PyQt5.QtCore import (QtDebugMsg, QtWarningMsg, QtCriticalMsg, QtFatalMsg, from PyQt5.QtCore import (QtDebugMsg, QtWarningMsg, QtCriticalMsg, QtFatalMsg,
qInstallMessageHandler) qInstallMessageHandler)
@ -284,12 +285,7 @@ def qt_message_handler(msg_type, context, msg):
# Handle this message specially. # Handle this message specially.
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")
try: faulthandler.disable()
import faulthandler
except ImportError:
pass
else:
faulthandler.disable()
record = qt.makeRecord(name, level, context.file, context.line, msg, None, record = qt.makeRecord(name, level, context.file, context.line, msg, None,
None, func) None, func)
qt.handle(record) qt.handle(record)