Skip to content

Commit

Permalink
fix exception printing
Browse files Browse the repository at this point in the history
  • Loading branch information
dhalbert committed Nov 17, 2021
1 parent f54c741 commit 1118911
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions asyncio/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1118911

Please sign in to comment.