Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork773
Fix PathFinder.find_module AttributeError for Python 3.12#1176
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
PathFinder.find_module() has been deprecated since Python 3.4 in favor offind_spec(), and it's finally removed in Python 3.12. This line willthrow an AttributeError which makes pymode completely unusable withpython 3.12.It was a hacky workaround introduced inpython-mode#1028. Maybe we can completelyremove this workaround because it's 4 years ago and the minimumsupported python version is now 3.6+.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The problem here is that we are not talking about the python version related to the code that is being edited and sometimes not even the python version from the current environment. It is the python version that was used during vim build time.
Just to be in the safe zone here I think we can leave this "monkey patch", but with your suggestion.
PathFinder.find_module() has been deprecated since Python 3.4 in favor of find_spec(), and it's finally removed in Python 3.12. This line will throw an AttributeError which makes pymode completely unusable with python 3.12.
It was a hacky workaround introduced in#1028. Maybe we can completely remove this workaround because it's 4 years ago and the minimum supported python version is now 3.6+.
I'm not sure if we can completely remove this monkey-patching at this point because I cannot guess where
vim.find_module
is ever used, but I'll leave it as the most compatible fallback.Ref: