aredis icon indicating copy to clipboard operation
aredis copied to clipboard

Suppression of CancelledError on Python 3.7

Open mjwestcott opened this issue 5 years ago • 1 comments

In Python 3.7, asyncio.CancelledError is a subclass of Exception.

https://github.com/NoneGG/aredis/blob/master/aredis/connection.py#L416

The above code (in the master branch) therefore catches CancelledError and raises a different exception. This is a problem for users that expect cancelled code to raise CancelledError in order to handle it appropriately.

In Python 3.8, CancelledError became a subclass of BaseException, to avoid this common problem.

(This is the same problem as https://github.com/NoneGG/aredis/issues/137, but in a different part of the code.)

mjwestcott avatar Aug 26 '20 01:08 mjwestcott

Potential fix: https://github.com/NoneGG/aredis/pull/170

mjwestcott avatar Aug 26 '20 01:08 mjwestcott