Skip to content

Commit 5213f8a

Browse files
committed
Make default_exception_handler handle exceptions when running repr
1 parent eb7a23d commit 5213f8a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

uvloop/loop.pyx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1508,7 +1508,10 @@ cdef class Loop:
15081508
if key in {'message', 'exception'}:
15091509
continue
15101510
value = context[key]
1511-
value = repr(value)
1511+
try:
1512+
value = repr(value)
1513+
except Exception as ex:
1514+
value = 'Exception in __repr__ {!r}'.format(ex)
15121515
log_lines.append('{}: {}'.format(key, value))
15131516

15141517
aio_logger.error('\n'.join(log_lines), exc_info=exc_info)

0 commit comments

Comments
 (0)