Commit 854caebc authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Task: Catch CancelledError when invoking callbacks

So callback methods don’t need to catch it they don’t need to handle
it specially
parent c0dc4baa
Pipeline #6455 passed with stages
in 31 seconds
......@@ -207,7 +207,13 @@ class Task:
if callback is None:
return
callback(self)
# Be conservative with catching exceptions here
# For example unittests raise Assertion errors
# which should not be catched here
try:
callback(self)
except CancelledError:
pass
def set_result(self, result):
self._result = result
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment