File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 " )
Original file line number Diff line number Diff 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" :
You can’t perform that action at this time.
0 commit comments