diff --git a/tests/fpcmoc/custom.py b/tests/fpcmoc/custom.py index c99dbd03..709ba93b 100755 --- a/tests/fpcmoc/custom.py +++ b/tests/fpcmoc/custom.py @@ -1,9 +1,15 @@ #!/usr/bin/python3 +import traceback +import sys import gi + gi.require_version('FPrint', '2.0') from gi.repository import FPrint, GLib +# Exit with error on any exception, included those happening in async callbacks +sys.excepthook = lambda *args: (traceback.print_exception(*args), sys.exit(1)) + ctx = GLib.main_context_default() c = FPrint.Context()