-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathversion_helpers.py
More file actions
24 lines (18 loc) · 792 Bytes
/
Copy pathversion_helpers.py
File metadata and controls
24 lines (18 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from platform import mac_ver
__all__ = [
"MacVersionHelpers"
]
class MacVersionHelpers:
@staticmethod
def is_mac_version_or_greater(minimum_major: int, minimum_minor: int) -> bool:
"""
Parameters:
major (int): The minimum major OS version number.
minor (int): The minimum minor OS version number.
Returns:
True if the specified version matches or if it is greater than the version of the current Mac OS. Otherwise, False.
"""
system_major, system_minor = mac_ver()[0].split(".")[:2]
system_major_int = int(system_major)
system_minor_int = int(system_minor)
return system_major_int > minimum_major or (system_major_int == minimum_major and system_minor_int >= minimum_minor)