Skip to content

Commit 1118911

Browse files
committed
fix exception printing
1 parent f54c741 commit 1118911

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

asyncio/core.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# fmt: off
1313

1414
from adafruit_ticks import ticks_ms as ticks, ticks_diff, ticks_add
15-
import sys, select
15+
import sys, select, traceback
1616

1717
# Import TaskQueue and Task, preferring built-in C code over Python code
1818
try:
@@ -278,9 +278,8 @@ def get_exception_handler():
278278
return Loop._exc_handler
279279

280280
def default_exception_handler(loop, context):
281-
print(context["message"])
282-
print("future:", context["future"], "coro=", context["future"].coro)
283-
sys.print_exception(context["exception"])
281+
exc = context["exception"]
282+
traceback.print_exception(None, exc, exc.__traceback__)
284283

285284
def call_exception_handler(context):
286285
(Loop._exc_handler or Loop.default_exception_handler)(Loop, context)

0 commit comments

Comments
 (0)