-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
pkg_resources
: Runtime fixes to make typing annotations work
#4262
pkg_resources
: Runtime fixes to make typing annotations work
#4262
Conversation
pkg_resoruces
: Runtime fixes to make typing annotations workpkg_resources
: Runtime fixes to make typing annotations work
…soruces-typign-fixes-for-annotations
pkg_resources/__init__.py
Outdated
@@ -2825,7 +2825,7 @@ def activate(self, path=None, replace=False): | |||
if path is None: | |||
path = sys.path | |||
self.insert_on(path, replace=replace) | |||
if path is sys.path: | |||
if path is sys.path and self.location: |
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.
I wonder if it is possible that self.location
is an empty string...
The empty string is a valid entry for sys.path
(and holds special meaning).
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.
Just in case:
if path is sys.path and self.location: | |
if path is sys.path and self.location is not None: |
But I am unsure if we should raise early or gracefully "do nothing" on None
Thank you very much @Avasam. |
Summary of changes
Should fix the last errors in #4246. These are all actual code changes, please review carefully.
Pull Request Checklist
newsfragments/
.(See documentation for details)