MCPcopy Index your code
hub / github.com/RustPython/RustPython / uname

Function uname

Lib/platform.py:968–1062  ·  view source on GitHub ↗

Fairly portable uname interface. Returns a tuple of strings (system, node, release, version, machine, processor) identifying the underlying platform. Note that unlike the os.uname function this also returns possible processor information as an additional tuple entry

()

Source from the content-addressed store, hash-verified

966
967
968def uname():
969
970 """ Fairly portable uname interface. Returns a tuple
971 of strings (system, node, release, version, machine, processor)
972 identifying the underlying platform.
973
974 Note that unlike the os.uname function this also returns
975 possible processor information as an additional tuple entry.
976
977 Entries which cannot be determined are set to ''.
978
979 """
980 global _uname_cache
981
982 if _uname_cache is not None:
983 return _uname_cache
984
985 # Get some infos from the builtin os.uname API...
986 try:
987 system, node, release, version, machine = infos = os.uname()
988 except AttributeError:
989 system = sys.platform
990 node = _node()
991 release = version = machine = ''
992 infos = ()
993
994 if not any(infos):
995 # uname is not available
996
997 # Try win32_ver() on win32 platforms
998 if system == 'win32':
999 release, version, csd, ptype = win32_ver()
1000 machine = machine or _get_machine_win32()
1001
1002 # Try the 'ver' system command available on some
1003 # platforms
1004 if not (release and version):
1005 system, release, version = _syscmd_ver(system)
1006 # Normalize system to what win32_ver() normally returns
1007 # (_syscmd_ver() tends to return the vendor name as well)
1008 if system == 'Microsoft Windows':
1009 system = 'Windows'
1010 elif system == 'Microsoft' and release == 'Windows':
1011 # Under Windows Vista and Windows Server 2008,
1012 # Microsoft changed the output of the ver command. The
1013 # release is no longer printed. This causes the
1014 # system and release to be misidentified.
1015 system = 'Windows'
1016 if '6.0' == version[:3]:
1017 release = 'Vista'
1018 else:
1019 release = ''
1020
1021 # In case we still don't know anything useful, we'll try to
1022 # help ourselves
1023 if system in ('win32', 'win16'):
1024 if not version:
1025 if system == 'win32':

Callers 8

test__locale.pyFile · 0.90
systemFunction · 0.70
nodeFunction · 0.70
releaseFunction · 0.70
versionFunction · 0.70
machineFunction · 0.70
processorFunction · 0.70
platformFunction · 0.70

Calls 10

_nodeFunction · 0.85
win32_verFunction · 0.85
_get_machine_win32Function · 0.85
_syscmd_verFunction · 0.85
java_verFunction · 0.85
android_verFunction · 0.85
ios_verFunction · 0.85
uname_resultClass · 0.85
anyFunction · 0.70
joinMethod · 0.45

Tested by

no test coverage detected