Get macOS version information and return it as tuple (release, versioninfo, machine) with versioninfo being a tuple (version, dev_stage, non_release_version). Entries which cannot be determined are set to the parameter values which default to ''. All tuple entries a
(release='', versioninfo=('', '', ''), machine='')
| 480 | |
| 481 | |
| 482 | def mac_ver(release='', versioninfo=('', '', ''), machine=''): |
| 483 | |
| 484 | """ Get macOS version information and return it as tuple (release, |
| 485 | versioninfo, machine) with versioninfo being a tuple (version, |
| 486 | dev_stage, non_release_version). |
| 487 | |
| 488 | Entries which cannot be determined are set to the parameter values |
| 489 | which default to ''. All tuple entries are strings. |
| 490 | """ |
| 491 | |
| 492 | # First try reading the information from an XML file which should |
| 493 | # always be present |
| 494 | info = _mac_ver_xml() |
| 495 | if info is not None: |
| 496 | return info |
| 497 | |
| 498 | # If that also doesn't work return the default values |
| 499 | return release, versioninfo, machine |
| 500 | |
| 501 | |
| 502 | # A namedtuple for iOS version information. |
no test coverage detected