Fix #101873: wmic not found on insider builds of Windows 11 #101874
@ -138,26 +138,27 @@ def _get_cpu_topology() -> CPUTopology:
|
|||||||
sockets = int(
|
sockets = int(
|
||||||
subprocess.check_output(
|
subprocess.check_output(
|
||||||
(
|
(
|
||||||
'wmic',
|
'powershell',
|
||||||
'computersystem',
|
'-Command',
|
||||||
'get',
|
'Get-CimInstance Win32_ComputerSystem | Select-Object -ExpandProperty NumberOfProcessors'
|
||||||
'NumberOfProcessors',
|
|
||||||
'/value',
|
|
||||||
),
|
),
|
||||||
text=True,
|
text=True,
|
||||||
)
|
)
|
||||||
.strip()
|
.strip()
|
||||||
.split('=')[1]
|
|
||||||
)
|
)
|
||||||
|
|
||||||
cores = sum(
|
cores = sum(
|
||||||
int(line.strip().split('=')[1])
|
int(core) for core in subprocess.check_output(
|
||||||
for line in subprocess.check_output(
|
(
|
||||||
('wmic', 'cpu', 'get', 'NumberOfCores', '/value'), text=True
|
'powershell',
|
||||||
|
'-Command',
|
||||||
|
'Get-CimInstance Win32_Processor | Select-Object -ExpandProperty NumberOfCores'
|
||||||
|
),
|
||||||
|
text=True
|
||||||
)
|
)
|
||||||
.strip()
|
.strip()
|
||||||
.split('\n')
|
.split('\n')
|
||||||
if line.strip()
|
if core
|
||||||
)
|
)
|
||||||
|
|
||||||
return CPUTopology(sockets=sockets, cores=cores, threads=multiprocessing.cpu_count())
|
return CPUTopology(sockets=sockets, cores=cores, threads=multiprocessing.cpu_count())
|
||||||
|
Loading…
Reference in New Issue
Block a user