Browse Source
Previously if a task running in the main_taskgroup raised, main_taskgroup might have never finished as fx.run (another task running in main_taskgroup) could not be cancelled (it was swallowing the CancelledError). Need to be careful with catching all Exceptions or BaseExceptions, as that might result in a coroutine not being cancellable. Note that from python 3.8 onwards, CancelledError will inherit from BaseException instead of Exception, so catching all Exceptions is somewhat less horrible but this will only really matter if we raise the min py version to 3.8... Really, all "except BaseException" lines are suspect and at least should be considered for replacement with "except Exception". ----- regarding fx.run not being cancellable before, and relevant lines, see:master6197cfbb3b/electrum/network.py (L1171)0decdffce2/aiorpcx/curio.py (L242)0decdffce2/aiorpcx/curio.py (L199)0decdffce2/aiorpcx/curio.py (L208)0decdffce2/aiorpcx/curio.py (L218)0decdffce2/aiorpcx/curio.py (L221)6197cfbb3b/electrum/daemon.py (L194)6197cfbb3b/electrum/daemon.py (L203)6197cfbb3b/electrum/exchange_rate.py (L507)6197cfbb3b/electrum/exchange_rate.py (L79)
3 changed files with 8 additions and 3 deletions
Loading…
Reference in new issue