From 111891167bd9ac0b1c82c941a5fb225e1b825c06 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 17 Nov 2021 17:55:39 -0500 Subject: [PATCH] fix exception printing --- asyncio/core.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/asyncio/core.py b/asyncio/core.py index 3a51727..f4440e2 100644 --- a/asyncio/core.py +++ b/asyncio/core.py @@ -12,7 +12,7 @@ # fmt: off from adafruit_ticks import ticks_ms as ticks, ticks_diff, ticks_add -import sys, select +import sys, select, traceback # Import TaskQueue and Task, preferring built-in C code over Python code try: @@ -278,9 +278,8 @@ def get_exception_handler(): return Loop._exc_handler def default_exception_handler(loop, context): - print(context["message"]) - print("future:", context["future"], "coro=", context["future"].coro) - sys.print_exception(context["exception"]) + exc = context["exception"] + traceback.print_exception(None, exc, exc.__traceback__) def call_exception_handler(context): (Loop._exc_handler or Loop.default_exception_handler)(Loop, context)