Author eryksun
Recipients eryksun, lemburg, paul.moore, sahsariga111, steve.dower, tim.golden, zach.ware
Date 2021-10-08.00:15:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1633652113.32.0.577957938578.issue45382@roundup.psfhosted.org>
In-reply-to
Content
> use the build number as reference instead of the major.minor

It could check the (major, minor, build) tuple, which allows reporting 10.1+ as "post11" and minimizes hard coding of build numbers. For example, given win32_ver() iterates by (major, minor, build) thresholds:

    _WIN32_CLIENT_RELEASES = [
        ((10, 1, 0), "post11"),
        ((10, 0, 22000), "11"),
        ((6, 4, 0), "10"),
        ((6, 3, 0), "8.1"),
        ((6, 2, 0), "8"),
        ((6, 1, 0), "7"),
        ((6, 0, 0), "Vista"),
        ((5, 2, 3790), "XP64"),
        ((5, 2, 0), "XPMedia"),
        ((5, 1, 0), "XP"),
        ((5, 0, 0), "2000"),
    ]

    _WIN32_SERVER_RELEASES = [
        ((10, 1, 0), "post2022Server"),
        ((10, 0, 20348), "2022Server"),
        ((10, 0, 17763), "2019Server"),
        ((6, 4, 0), "2016Server"),
        ((6, 3, 0), "2012ServerR2"),
        ((6, 2, 0), "2012Server"),
        ((6, 1, 0), "2008ServerR2"),
        ((6, 0, 0), "2008Server"),
        ((5, 2, 0), "2003Server"),
        ((5, 0, 0), "2000Server"),
    ]

In win32_ver():

    if major >= 5: # NT systems
        if getattr(winver, 'product_type', None) == 3: # VER_NT_SERVER
            release_list = _WIN32_SERVER_RELEASES
        else:
            release_list = _WIN32_CLIENT_RELEASES
        ver = major, minor, build
        for release_ver, release_name in release_list:
            if ver >= release_ver:
                release = release_name
                break
History
Date User Action Args
2021-10-08 00:15:13eryksunsetrecipients: + eryksun, lemburg, paul.moore, tim.golden, zach.ware, steve.dower, sahsariga111
2021-10-08 00:15:13eryksunsetmessageid: <1633652113.32.0.577957938578.issue45382@roundup.psfhosted.org>
2021-10-08 00:15:13eryksunlinkissue45382 messages
2021-10-08 00:15:13eryksuncreate