Created
July 24, 2013 15:29
-
-
Save radix/6071626 to your computer and use it in GitHub Desktop.
inlineCallbacks tracebacks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> from twisted.internet.defer import inlineCallbacks | |
>>> @inlineCallbacks | |
... def a(): | |
... yield b() | |
... | |
>>> @inlineCallbacks | |
... def b(): | |
... yield c() | |
... | |
>>> def c(): 1 / 0 | |
... | |
>>> a() | |
<Deferred at 0x21140e0 current result: <twisted.python.failure.Failure <type 'exceptions.ZeroDivisionError'>>> | |
>>> a().result.printTraceback() | |
Traceback (most recent call last): | |
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1214, in unwindGenerator | |
return _inlineCallbacks(None, gen, Deferred()) | |
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1071, in _inlineCallbacks | |
result = g.send(result) | |
File "<stdin>", line 3, in a | |
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1214, in unwindGenerator | |
return _inlineCallbacks(None, gen, Deferred()) | |
--- <exception caught here> --- | |
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1071, in _inlineCallbacks | |
result = g.send(result) | |
File "<stdin>", line 3, in b | |
File "<stdin>", line 1, in c | |
exceptions.ZeroDivisionError: integer division or modulo by zero |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment