See https://docs.python.org/3.11/library/asyncio-eventloop.html#error-handling-api
(loop, context)
| 382 | loop = asyncio.get_running_loop() |
| 383 | |
| 384 | def exceptionHandler(loop, context): |
| 385 | "See https://docs.python.org/3.11/library/asyncio-eventloop.html#error-handling-api" |
| 386 | error = context["exception"] |
| 387 | try: |
| 388 | globalInitModule.uncaughtExceptionHandler(error) |
| 389 | except SystemExit: # the "exception" raised by `sys.exit()` call |
| 390 | pass |
| 391 | finally: |
| 392 | pm.stop() # unblock `await pm.wait()` to gracefully exit the program |
| 393 | nonlocal hasUncaughtException |
| 394 | hasUncaughtException = True |
| 395 | loop.set_exception_handler(exceptionHandler) |
| 396 | |
| 397 | def cleanupExit(code=0): |
nothing calls this directly
no outgoing calls
no test coverage detected