diff --git a/source/carla_host.py b/source/carla_host.py index 1daf98610..89ba4d525 100644 --- a/source/carla_host.py +++ b/source/carla_host.py @@ -60,6 +60,12 @@ try: except: hasGL = False +# ------------------------------------------------------------------------------------------------------------ +# Safe exception hook, needed for PyQt5 + +def sys_excepthook(type, value, tback): + return sys.__excepthook__(type, value, tback) + # ------------------------------------------------------------------------------------------------------------ # Session Management support @@ -2492,6 +2498,9 @@ def initHost(initName, libPrefix, isControl, isPlugin, failError, HostClass = No sys.stdout = CarlaPrint(False) sys.stderr = CarlaPrint(True) + if config_UseQt5: + sys.excepthook = sys_excepthook + # -------------------------------------------------------------------------------------------------------- # Done