Created
August 28, 2015 16:15
-
-
Save nramirezuy/a96432aa3f06a204a8b9 to your computer and use it in GitHub Desktop.
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
import sys | |
from twisted.internet import defer, reactor | |
from twisted.python import log | |
@defer.inlineCallbacks | |
def raise_typeerror(): | |
try: | |
1 / 0 | |
except: | |
yield | |
raise | |
@defer.inlineCallbacks | |
def working_fine(): | |
try: | |
1 / 0 | |
except: | |
defer.fail() | |
yield | |
def run(): | |
# d = raise_typeerror() | |
d = working_fine() | |
d.addErrback(log.err) | |
d.addBoth(lambda n: reactor.stop()) | |
if __name__ == '__main__': | |
reactor.callWhenRunning(run) | |
reactor.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment