Skip to content

Instantly share code, notes, and snippets.

@Niakr1s
Last active April 15, 2018 11:04
Show Gist options
  • Save Niakr1s/7de1d9254ad0b5c1674fc6e44aecf74a to your computer and use it in GitHub Desktop.
Save Niakr1s/7de1d9254ad0b5c1674fc6e44aecf74a to your computer and use it in GitHub Desktop.
Pycharm to show PyQT exceptions
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