Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix getting futures exceptions #154

Merged
merged 1 commit into from
Dec 13, 2022

Conversation

decaz
Copy link
Contributor

@decaz decaz commented Dec 2, 2022

Access to asyncio.Future.exception() should be protected from unexpected raise of asyncio.CancelledError exception.

@decaz
Copy link
Contributor Author

decaz commented Dec 2, 2022

@mosquito I see there is another place where exception() method of future is being used:

aiormq/aiormq/base.py

Lines 98 to 101 in 9696466

def _create_closing_future(self) -> asyncio.Future:
future = self.__future_store.create_future()
future.add_done_callback(lambda x: x.exception())
return future

But I guess it's normal that asyncio.CancelledError can be raised here. Am I right?

@mosquito mosquito self-requested a review December 2, 2022 21:04
@mosquito mosquito merged commit e1dd879 into mosquito:master Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants