]> git.ipfire.org Git - thirdparty/tornado.git/commit
Improve debug support for asyncio futures 2192/head
authorAntoine Pitrou <antoine@python.org>
Tue, 7 Nov 2017 21:19:39 +0000 (22:19 +0100)
committerAntoine Pitrou <antoine@python.org>
Tue, 7 Nov 2017 21:19:39 +0000 (22:19 +0100)
commit18dd6827d6d6cce1df9909af9b79e873063277c0
tree3512947d2bb1e1a7dfb085e0b00d780902e30761
parentcccd5fad380f22ab45ecd2a6b3ab60638778efb3
Improve debug support for asyncio futures

When in debug mode, asyncio returns the instantiation place of a Future
and places it in its repr(), for example:

  <Future finished result=None created at /home/antoine/distributed/distributed/worker.py:1223>

This is useful when asyncio logs cancelled futures or futures that were not
waited upon after erroring out.

However, when using @gen.coroutine, we need to fix the recorded stack trace
otherwise the display is much less useful:

  <Future finished result=None created at /home/antoine/tornado/tornado/gen.py:295>
tornado/gen.py
tornado/test/gen_test.py