MCPcopy Index your code
hub / github.com/python/cpython / _get_machine_win32

Function _get_machine_win32

Lib/platform.py:792–817  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

790
791
792def _get_machine_win32():
793 # Try to use the PROCESSOR_* environment variables
794 # available on Win XP and later; see
795 # http://support.microsoft.com/kb/888731 and
796 # http://www.geocities.com/rick_lively/MANUALS/ENV/MSWIN/PROCESSI.HTM
797
798 # WOW64 processes mask the native architecture
799 try:
800 [arch, *_] = _wmi_query('CPU', 'Architecture')
801 except OSError:
802 pass
803 else:
804 try:
805 arch = ['x86', 'MIPS', 'Alpha', 'PowerPC', None,
806 'ARM', 'ia64', None, None,
807 'AMD64', None, None, 'ARM64',
808 ][int(arch)]
809 except (ValueError, IndexError):
810 pass
811 else:
812 if arch:
813 return arch
814 return (
815 os.environ.get('PROCESSOR_ARCHITEW6432', '') or
816 os.environ.get('PROCESSOR_ARCHITECTURE', '')
817 )
818
819
820class _Processor:

Callers 2

get_win32Method · 0.85
unameFunction · 0.85

Calls 2

_wmi_queryFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…