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 ValueError when importing gsd in a non-main thread. #258

Merged
merged 4 commits into from
Jun 20, 2023

Conversation

joaander
Copy link
Member

Description

Catch and ignore ValueError raised by signal.signal.

Motivation and Context

Downstream users running xdist report failures: #255 (comment).

I can't imagine that users would separate their imports into a separate Python thread during normal production use.

Resolves #257.

How Has This Been Tested?

I executed the test case in #257 before and after the fix.

It is not possible to test this in pytest (without xdist), as gsd will have been imported into the interpreter before any threading test starts.

Checklist:

  • I have reviewed the Contributor Guidelines.
  • I agree with the terms of the GSD Contributor Agreement.
  • My name is on the list of contributors (doc/credits.rst) in the pull request source branch.
  • I have added a change log entry to CHANGELOG.rst.

Allows users to `import gsd` in a separate thread.
@joaander joaander merged commit 6afc4af into trunk-patch Jun 20, 2023
@joaander joaander deleted the fix-signal-import-thread branch June 20, 2023 13:12
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.

ValueError: signal only works in main thread of the main interpreter
2 participants