-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exit after Run #6
Comments
I'm having the same problem, probably for the same reasons of not really understanding, but calling |
Same here it comes from the underlying Twisted code python3.6/site-packages/twisted/internet/task.py in react(main, argv, _reactor)
935 finished.addBoth(cbFinish)
936 _reactor.run()
--> 937 sys.exit(codes[0]) is there no way to use this in a project other than having a I guess this lib is specialised for Twisted apps where this weird behaviour must be normal or something |
Hi, I was having an issue with this also and like @anentropic found that this is expected behaviour for twisted.internet.task.react on completion. https://twistedmatrix.com/documents/15.0.0/api/twisted.internet.task.react.html You can work around this by simply handling the SystemExit exception. eg. def do_requests(self):
try:
self.session.run(self._main)
except SystemExit:
logger.info("Ignoring twisted.internet.task.react sys.exit on completion.") This could probably be better handled within requests-threads, rather than expecting it to be handled by the user. I'll take a closer look later on and perhaps submit a pull request. Cheers, Nathan. |
Hello,
I'm just learning async, so this might just be dumb, and it seems my piece here is working fine, other than it is returning
Process finished with exit code 0
after I run the class.`class foo:
The text was updated successfully, but these errors were encountered: