Skip to content

Commit d5edb4e

Browse files
Fix "Print host info" CI step on Mac OS (arm64) (#8638)
1 parent 1ec61a1 commit d5edb4e

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

continuous_integration/scripts/host_info.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,16 @@ def main() -> None:
3030
bench()
3131
print(f"Crude CPU benchmark (higher is better): {bench():.1f}")
3232

33-
freqs = psutil.cpu_freq(percpu=True)
34-
print("CPU frequency:")
35-
for freq in freqs:
36-
# FIXME types-psutil
37-
print(f" - current={freq.current}, min={freq.min}, max={freq.max}") # type: ignore
33+
try:
34+
freqs = psutil.cpu_freq(percpu=True)
35+
# https://github.com/giampaolo/psutil/issues/2382
36+
except RuntimeError:
37+
print("CPU frequency: not available")
38+
else:
39+
print("CPU frequency:")
40+
for freq in freqs:
41+
# FIXME types-psutil
42+
print(f" - current={freq.current}, min={freq.min}, max={freq.max}") # type: ignore
3843

3944
mem = psutil.virtual_memory()
4045
print("Memory:")

0 commit comments

Comments
 (0)