Skip to content
This repository was archived by the owner on Feb 8, 2023. It is now read-only.
This repository was archived by the owner on Feb 8, 2023. It is now read-only.

get_os_version_major assumes two dots in version number #33

@aysiu

Description

@aysiu

The code here to get the OS major version:
https://github.com/erikng/nudge/blob/master/payload/Library/nudge/Resources/nudge#L131-L134

def get_os_version_major():
    '''Return major OS version.'''
    full_os = platform.mac_ver()[0]
    return LooseVersion(full_os.rsplit('.', 1)[0])

assumes that platform.mac_ver()[0] will return something like 10.15.0 instead of 10.15. If it deals with something like 10.15, then the function will return 10.

Re-think the logic to account for both types of scenarios.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions