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

Function system_alias

tools/python-3.11.9-amd64/Lib/platform.py:501–539  ·  view source on GitHub ↗

Returns (system, release, version) aliased to common marketing names used for some systems. It also does some reordering of the information in some cases where it would otherwise cause confusion.

(system, release, version)

Source from the content-addressed store, hash-verified

499### System name aliasing
500
501def system_alias(system, release, version):
502
503 """ Returns (system, release, version) aliased to common
504 marketing names used for some systems.
505
506 It also does some reordering of the information in some cases
507 where it would otherwise cause confusion.
508
509 """
510 if system == 'SunOS':
511 # Sun's OS
512 if release < '5':
513 # These releases use the old name SunOS
514 return system, release, version
515 # Modify release (marketing release = SunOS release - 3)
516 l = release.split('.')
517 if l:
518 try:
519 major = int(l[0])
520 except ValueError:
521 pass
522 else:
523 major = major - 3
524 l[0] = str(major)
525 release = '.'.join(l)
526 if release < '6':
527 system = 'Solaris'
528 else:
529 # XXX Whatever the new SunOS marketing name is...
530 system = 'Solaris'
531
532 elif system in ('win32', 'win16'):
533 # In case one of the other tricks
534 system = 'Windows'
535
536 # bpo-35516: Don't replace Darwin with macOS since input release and
537 # version arguments can be different than the currently running version.
538
539 return system, release, version
540
541### Various internal helpers
542

Callers 1

platformFunction · 0.85

Calls 3

strFunction · 0.85
splitMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected