[issue32528] Change base class for futures.CancelledError

Bruce Merry report at bugs.python.org
Mon Jul 6 15:56:10 EDT 2020


Bruce Merry <bmerry at gmail.com> added the comment:

FYI this has just bitten me after updating my OS to one that ships Python 3.8. It is code that was written with asyncio cancellation in mind and which expected CancelledError to be caught with "except Exception" (the exception block unwound incomplete operations before re-raising the exception).

It's obviously too late to do anything about Python 3.8, but I'm mentioning this as a data point in support of having a deprecation period if similar changes are made in future.

On the plus side, while fixing up my code and checking all instances of "except Exception" I found some places where this change did fix latent cancellation bugs. So I'm happy with the change, just a little unhappy that it came as a surprise.

----------
nosy: +bmerry

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32528>
_______________________________________


More information about the Python-bugs-list mailing list