-
Notifications
You must be signed in to change notification settings - Fork 42
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
Disable import of pkg_resources for Python 3.3+ #11
base: develop
Are you sure you want to change the base?
Conversation
…into python3_fix
…into python3_fix
…into python3_fix
src/infi/__init__.py
Outdated
@@ -1 +1,3 @@ | |||
__import__("pkg_resources").declare_namespace(__name__) | |||
import sys | |||
if sys.hexversion < 0x30300f0: |
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.
Why not use sys.version
here? https://stackoverflow.com/questions/1093322/
My main concern here is that this doesn't look very good ;)
updated to use sys.version_info, which is quite a bit more readable :) |
Since Python <=3.3 isn't supported any more, I suggest removing the "declare_namespace" code altogether, then we can merge this ;) |
@wiggin15 do you have perms in this repo? I see it's been inactive for 5 years with lots of hanging PRs. |
Hi @C0rn3j . I'm afraid I don't have access any more as I no longer work for the company that manages this repo (Infinidat). |
Oh well. https://github.com/C0rn3j/lynxtray https://pypi.org/project/lynxtray/ There's also https://github.com/moses-palmer/pystray which is cross-platform, but similarly dead, and it was faster for me to port the one we were using. |
Why haven't you merged the changes and updated the package on Pypi yet? It's 2025 and I'm still having this problem. Python 3.3 is no longer relevant. Just remove this line
|
Hi. I used my priviledges on PyPI to upload a hotfix removing these 2 lines. I don't have a Windows machine to try it on, so please help me verify the fix. |
I remove this line in |
I created a new pull request because of issues with my first fork.
is deprecated in Python 3.3+ and causes issues with pyinstaller (mainly having to import the entire pkg_resources package, which is quite large). So checking the version number and not doing the import for these versions is likely the best solution to keep Python 2.x compatibility.
I have tested this in Python 3.6.5 and everything works as expected with this patch.