File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -276,6 +276,8 @@ def get_number_of_sockets(self) -> int:
276276 cmd = "cat /proc/cpuinfo | grep 'physical id' | sort -u | wc -l"
277277 if psutil .WINDOWS :
278278 cmd = r'wmic cpu get DeviceID | C:\Windows\System32\find.exe /C "CPU"'
279+ elif psutil .MACOS : # pragma: no cover
280+ cmd = "sysctl -n machdep.cpu.core_count"
279281
280282 with subprocess .Popen (
281283 args = cmd ,
@@ -918,6 +920,8 @@ def get_number_of_sockets() -> int:
918920 cmd = "cat /proc/cpuinfo | grep 'physical id' | sort -u | wc -l"
919921 if sys .platform == "win32" :
920922 cmd = 'wmic cpu get DeviceID | find /c "CPU"'
923+ elif sys .platform == "darwin" : # pragma: no cover
924+ cmd = "sysctl -n machdep.cpu.core_count"
921925
922926 proc = subprocess .Popen (
923927 args = cmd ,
You can’t perform that action at this time.
0 commit comments