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

Hooks: Use load_hook to support python >= 3.12 | < 3.5 #746

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ahmubashshir
Copy link
Contributor

Fixes #736
Signed-off-by: Mubashshir ahmubashshir@gmail.com

Fixes z411#736
Signed-off-by: Mubashshir <ahmubashshir@gmail.com>
@ahmubashshir ahmubashshir marked this pull request as ready for review January 5, 2025 19:05
Comment on lines +315 to +317
except ImportError:
def load_hook(loader, name):
return loader.find_module(name).load_module(name)
Copy link
Collaborator

Choose a reason for hiding this comment

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

trackma currently requires Python 3.8, so we don't need this fallback code for <3.5 (which is ancient).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm stuck in implementing this here... loader.find_module().load_module() allowed importing sibling packages, but newer one doesn't... so I'm stuck on this... Is there any way to do this without resorting to sys.path modification?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Guess I'll have to take a look at testing this myself. No promises when I'll get to that, though.

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.

'FileFinder' object has no attribute 'find_module'
2 participants