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 incorrect import of exception from kiwipy.communications #5947

Merged
merged 2 commits into from
Mar 31, 2023

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Mar 29, 2023

The aiida.engine.processes.control._resolve_futures method was importing the CommunicationTimeout from kiwipy.communications however this class does not exist. Probably the TimeoutError was meant, which is simply an alias of concurrent.futures.TimeoutError.

The `aiida.engine.processes.control._resolve_futures` method was
importing the `CommunicationTimeout` from `kiwipy.communications`
however this class does not exist. Probably the `TimeoutError` was
meant, which is simply an alias of `concurrent.futures.TimeoutError`.
@sphuber sphuber requested a review from unkcpz March 29, 2023 14:55
@@ -262,7 +262,7 @@ def handle_result(result):
# unwrap is need here since LoopCommunicator will also wrap a future
future = unwrap_kiwi_future(future)
result = future.result()
except communications.CommunicationTimeout:
except communications.TimeoutError:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just check the history, it used to be from aiida.manage.external.rmq import CommunicationTimeout.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And there it used to be defined as CommunicationTimeout = kiwipy.communications.TimeoutError # pylint: disable=invalid-name So this PR is restoring that behavior

@sphuber sphuber requested a review from unkcpz March 31, 2023 12:37
Copy link
Member

@unkcpz unkcpz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@sphuber sphuber merged commit e2df40d into aiidateam:main Mar 31, 2023
@sphuber sphuber deleted the fix/incorrect-kiwipy-exception branch March 31, 2023 13:17
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.

None yet

2 participants