MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _mac_ver_xml

Function _mac_ver_xml

tools/python-3.11.9-amd64/Lib/platform.py:414–433  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

412
413
414def _mac_ver_xml():
415 fn = '/System/Library/CoreServices/SystemVersion.plist'
416 if not os.path.exists(fn):
417 return None
418
419 try:
420 import plistlib
421 except ImportError:
422 return None
423
424 with open(fn, 'rb') as f:
425 pl = plistlib.load(f)
426 release = pl['ProductVersion']
427 versioninfo = ('', '', '')
428 machine = os.uname().machine
429 if machine in ('ppc', 'Power Macintosh'):
430 # Canonical name
431 machine = 'PowerPC'
432
433 return release, versioninfo, machine
434
435
436def mac_ver(release='', versioninfo=('', '', ''), machine=''):

Callers 1

mac_verFunction · 0.85

Calls 3

openFunction · 0.70
existsMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected