Implement sys.getwindowsversion - #2002
Conversation
There was a problem hiding this comment.
Because this is not a documented or a CPython compitible attribute, naming to _getwindowsversion_type to mark it non-public and adding comment like // XXX: This is not a python spec but required by current RustPython implementation will be appreciated
There was a problem hiding this comment.
I just added some test cases and renamed the type. Could you check it again?
| Ok(()) | ||
| } | ||
|
|
||
| #[pystruct_sequence(name = "sys._getwindowsversion_type")] |
There was a problem hiding this comment.
Actual name below is required to be aliased with _ prefix, but this one is not. This name can be sys.getwindowsversion without any problem.
To make things clear,
- The name here is the type name.
- The name below is the attrname of the sys module.
There was a problem hiding this comment.
Oh, thank you! I was bit confused about the differences between them.
There was a problem hiding this comment.
Would you please rebase this PR to upstream? This macro have a bit different signature due to #2020.
There was a problem hiding this comment.
Would you mind if I rearrange commit history a little bit while rebasing? I'd like to clean up commits related to formatting.
There was a problem hiding this comment.
Cleaning up local history by rebasing is (almost) always recommended, welcome
Compatibility note: The return type of this function has a different name from CPython.
a928040 to
1505c9a
Compare

This PR fixes #1996.
Note
embed_resourcecrate.platform_versionreturns the result fromGetVersionExW, which is not accurate when running application in compatibility mode.