aredis
aredis copied to clipboard
[PUBSUB] When cancelling a task, CancelledError exception is not propagated to client code.
The same as #137 but for PubSub
Checklist
- Python version 3.8.5
- Using Python parser
- Using asyncio event loop
- Issue does exist against the
masterbranch of aredis
Steps to reproduce
Run a blocking command in an asyncio task (created with asyncio.create_task or ensure_future, such as get_message(), and try to cancel that task.
Expected behavior
asyncio.CancelledError is propagated to client code, so that cleanup or other such things can be done in client code.
Actual behavior
The exception is caught but not propagated in various places.
Problematic place:
https://github.com/NoneGG/aredis/blob/b46e67163692cd0796763e5c9e17394821d9280c/aredis/pubsub.py#L112-L118