Last active
April 15, 2018 11:04
-
-
Save Niakr1s/7de1d9254ad0b5c1674fc6e44aecf74a to your computer and use it in GitHub Desktop.
Pycharm to show PyQT exceptions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PyQt5 import QtCore | |
import traceback, sys | |
# https://stackoverflow.com/questions/44447674/traceback-missing-when-exception-encountered-in-pyqt5-code-in-eclipsepydev | |
if QtCore.QT_VERSION >= 0x50501: | |
def excepthook(type_, value, traceback_): | |
traceback.print_exception(type_, value, traceback_) | |
QtCore.qFatal('') | |
sys.excepthook = excepthook |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment