There are a couple of issues in the way numexpr.cpu.info is used in print_versions():
1) all the subclasses of CPUInfoBase have a class attribute info, whereas CPUInfoBase does not; this means that, in case there is no CPU implementation for an OS, self.info returns a function (because of CPUInfoBase.__getattr__()) which is not subscriptable
2) only few subclasses of CPUInfoBase (e.g. LinuxCPUInfo, Win32CPUInfo) implement info as list of dicts for each CPU, whereas the rest of the implementations use a dict with attributes
Since info seems to be mostly an internal detail, then adapt print_versions() to be a little more flexible:
do not try to query attributes in case the actual CPU implementation is CPUInfoBase: it is not implemented for the current OS, so there is nothing to query anyway (fixes (1))
get the first element of info only in case it is a list (fixes (2))
drop the catch of KeyError, which should not happen anymore now
There are a couple of issues in the way
numexpr.cpu.info
is used inprint_versions()
:1) all the subclasses of
CPUInfoBase
have a class attributeinfo
, whereasCPUInfoBase
does not; this means that, in case there is no CPU implementation for an OS,self.info
returns a function (because ofCPUInfoBase.__getattr__()
) which is not subscriptable 2) only few subclasses ofCPUInfoBase
(e.g.LinuxCPUInfo
,Win32CPUInfo
) implementinfo
as list of dicts for each CPU, whereas the rest of the implementations use a dict with attributesSince
info
seems to be mostly an internal detail, then adaptprint_versions()
to be a little more flexible:CPUInfoBase
: it is not implemented for the current OS, so there is nothing to query anyway (fixes (1))info
only in case it is a list (fixes (2))KeyError
, which should not happen anymore now