If future.exception() is not called (even on cancelled futures), it seems Python will then log 'Task exception was never retrieved'. Rewriting this logic slightly should hopefully achieve the same functionality while preventing the Python errors.
Coverage: 88.84% (-0.04%) from 88.878% when pulling a6ce88e2bb9e2c241848f882a2dc2e39e539415e on torarvid:torarvid/prevent-task-exception into 05b7cfd9efa88b2a0284816e4f351b454fe2c162 on mosquito:master.
If future.exception() is not called (even on cancelled futures), it seems Python will then log 'Task exception was never retrieved'. Rewriting this logic slightly should hopefully achieve the same functionality while preventing the Python errors.