bpo-35344: platform.platform() uses mac_ver() on macOS#10780
bpo-35344: platform.platform() uses mac_ver() on macOS#10780vstinner merged 1 commit intopython:masterfrom vstinner:platform_macos
Conversation
On macOS, platform.platform() now uses mac_ver(), if it returns a non-empty release string, to get the macOS version rather than darwin version.
|
I rebased my PR and squashed all commits into a single commit. The test should now pass on Windows, Linux and macOS ;-) |
|
@malemburg, @ned-deily, @ronaldoussoren: So, what do you think of: instead of: ? |
|
Is there any reason to not change platform.platform() in Python 3.8 on macOS? |
| # macOS (darwin kernel) | ||
| macos_release = mac_ver()[0] | ||
| if macos_release: | ||
| # note: 'macOS' is different than 'MacOS' used below |
There was a problem hiding this comment.
This is something for another pull request, but the 'MacOS' bits you mention here are a leftover from the long removed MacOS 9 port and should be removed.
I like this, information about macOS is more interesting than information about the kernel version. I'm not very happy with the processor information at the end, but that's unrelated to the change you are proposing:
This platform output includes "64bit" because the binary for python3.6 includes support for both i386 and x86_64, and doesn't show that the command is using i386 instructions. |
To be honest, I don't understand the purpose of the platform.architecture() function :-) For me, sys.maxsize > 2**31 should be enough to distinguish 32 and 64 bits platforms, no? |
|
Ronald:
I wrote PR #10959 for that. |
@ronaldoussoren: Please open a new issue if you would like to change that. I have no idea why we have the current info nor how to change them. |
On macOS, platform.platform() now uses mac_ver(), if it returns a
non-empty release string, to get the macOS version rather than darwin
version.
https://bugs.python.org/issue35344