Skip to content

Commit 472855d

Browse files
authored
MAINT: Make sys_info more robust (#13810)
1 parent 678d4d3 commit 472855d

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

mne/utils/config.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -776,15 +776,15 @@ def sys_info(
776776
out("Executable".ljust(ljust) + sys.executable + "\n")
777777
try:
778778
cpu_brand = _get_cpu_brand()
779-
except Exception:
780-
cpu_brand = "?"
779+
except Exception as exc:
780+
cpu_brand = f"? (could not determine: {exc})"
781781
out("CPU".ljust(ljust) + f"{cpu_brand} ")
782782
out(f"({multiprocessing.cpu_count()} cores)\n")
783783
out("Memory".ljust(ljust))
784784
try:
785785
total_memory = _get_total_memory()
786-
except UnknownPlatformError:
787-
total_memory = "?"
786+
except Exception as exc:
787+
total_memory = f"? (could not determine: {exc})"
788788
else:
789789
total_memory = f"{total_memory / 1024**3:.1f}" # convert to GiB
790790
out(f"{total_memory} GiB\n")

mne/utils/tests/test_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def test_sys_info_basic():
114114
assert "numpy" in out
115115
# replace all in-line whitespace with single space
116116
out = "\n".join(" ".join(o.split()) for o in out.splitlines())
117-
assert "? GiB" not in out
117+
assert "?" not in out
118118
if platform.system() == "Darwin":
119119
assert "Platform macOS-" in out
120120
elif platform.system() == "Linux":

0 commit comments

Comments
 (0)