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
Incorrect condition test in platform.py #52539
Comments
While looking at bpo-4440, I grepped for similar problems and found one in if no_os_uname or not filter(None, (system, node, release, version, machine)) In 3.x, filter() returns an object, not a list, so 'not filter()' will always be false. One fix is to either convert filter's output by adding list() or tuple(). Another fix could be 'not any ((system, node, release, version, machine))', but I don't know if platform.py is trying to stay compatible with versions of Python that lack any(). |
A.M. Kuchling wrote:
I'm trying to keep platform.py compatible with all Python versions |
It seems that the "Lib/lib2to3/fixes/fix_filter.py" should have fixed all the "filter" problem in py3k, by adding a "list()" call to "filter()". It's werid this one still exists in standar library. Also I found other two problems with "filter" in standar library. So I make a patch to fix these three problems. |
Thanks, committed patch as r83371. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: