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

Fixed path in resource_string to use package for compatibility with older versions #42

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

manan-memon
Copy link
Contributor

The issue with using the __name__ variable while reading files via the importlib-resource library in older versions (e.g., 3.1.2) results in the following error:

get_package raises TypeError('{!r} is not a package'.format(package))
TypeError: 'h5pxblock.h5pxblock' is not a package

This PR updates the reference to __package__ instead of __name__ to ensure compatibility with older versions of the library.

Changes have been tested on both versions 3.1.2 and 6.4.5 (latest) of importlib-resources and are working correctly.

@manan-memon manan-memon force-pushed the manan/fix-importlibresource-package-path branch from c139a7b to 5cc106f Compare September 30, 2024 15:51
Copy link
Contributor

@ziafazal ziafazal left a comment

Choose a reason for hiding this comment

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

👍

@ziafazal ziafazal merged commit 2d2a985 into master Oct 1, 2024
1 check passed
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.

3 participants