STINNER Victor added the comment:

> I think this patch is bad and should be reverted. It always calls 
> traceback.format_exception() which is an expensive operation, while the 
> _TracebackLogger takes care to call it only when necessary.

Oh, I didn't notice that, and I agree that the new code is inefficient.

Since the Future object does not release the reference to the exception after 
result() or exception() has been called, there is no need to preformat the 
exception. It can be done in the destructor.

Attached asyncio_defer_format_tb.patch implements that.

Future.set_exception() creates a reference cycle. I created the issue #20032 to 
discuss that.

----------
resolution: fixed -> 
Added file: http://bugs.python.org/file33229/asyncio_defer_format_tb.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19967>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to