[issue19967] asyncio: remove _TracebackLogger

STINNER Victor report at bugs.python.org
Fri Dec 20 10:55:28 CET 2013


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 <report at bugs.python.org>
<http://bugs.python.org/issue19967>
_______________________________________


More information about the Python-bugs-list mailing list