-
Notifications
You must be signed in to change notification settings - Fork 429
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
get_stdlib_dir(): Don't select python3.1 symlink; select python3.10 #4479
Conversation
3e084f3
to
6f5a4c9
Compare
@kenodegard Thanks for the review. I've implemented your suggestion to filter out symlinks before selecting the directory. |
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.
Hehe, I was torn between my suggestion and importing itertools.filterfalse
. Thanks for choosing the cleaner option!
cc @isuruf (for awareness) |
@@ -1008,6 +1009,7 @@ def get_stdlib_dir(prefix, py_ver): | |||
else: | |||
lib_dir = os.path.join(prefix, 'lib') | |||
python_folder = glob(os.path.join(lib_dir, 'python?.*')) | |||
python_folder = sorted(filterfalse(islink, python_folder)) |
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.
Loving this!
This way, variables like
STDLIB_DIR
andSP_DIR
will point to thepython3.10
directory, not the symlinkpython3.1
.Fixes #4477
Related threads: