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: don't check sys.modules before dynamic import #94

Merged
merged 1 commit into from
Aug 26, 2021

Conversation

r1b
Copy link
Contributor

@r1b r1b commented Aug 9, 2021

  1. importlib.import_module already does this.
  2. Moreover, you must acquire the import lock before checking sys.modules. importlib.import_module does this for you.

Fixes #61

1. `importlib.import_module` [already does this](https://github.com/python/cpython/blob/7d14fdb03c3e8384c01da1b21647ce837ed6a29c/Lib/importlib/_bootstrap.py#L1033-L1046)
2. Moreover, you must acquire the import lock before checking sys.modules. `importlib.import_module` does this for you.

Fixes crs4#61
@svituz
Copy link
Member

svituz commented Aug 26, 2021

Thanks for your contribution and for closing a long-standing bug

@svituz svituz merged commit ebca2a0 into crs4:develop Aug 26, 2021
@r1b r1b deleted the fix/sys-modules-threads branch August 27, 2021 00:31
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.

AttributeError: module 'hl7apy.v2_5' has no attribute 'get'
2 participants