One function

_get_cpu_info_from_sysctl in workhorsy/py-cpuinfo

The author described this change as Fixed Bug #59: Not working on OS X 10.12 Sierra. It counts as a record because the check below fails on the code as it stood at e1cccf2ab and passes on 8b6e23043, with nothing else changed between the two runs.

Fix saved2017-04-05
Sharing licenceMIT · LICENSE
Change size+3 3

What the code was meant to do, written into the code itself as a docstring

Returns the CPU info gathered from sysctl. Returns {} if sysctl is not found.

The change

2222 family = _get_field(False, output, int, 0, 'machdep.cpu.family')
2323
2424 # Flags
25- flags = _get_field(False, output, None, None, 'machdep.cpu.features').lower().split()
26- flags.extend(_get_field(False, output, None, None, 'machdep.cpu.leaf7_features').lower().split())
27- flags.extend(_get_field(False, output, None, None, 'machdep.cpu.extfeatures').lower().split())
25+ flags = _get_field(False, output, None, '', 'machdep.cpu.features').lower().split()
26+ flags.extend(_get_field(False, output, None, '', 'machdep.cpu.leaf7_features').lower().split())
27+ flags.extend(_get_field(False, output, None, '', 'machdep.cpu.extfeatures').lower().split())
2828 flags.sort()
2929
3030 # Convert from GHz/MHz string to Hz

The check that tells the two apart

failpass·tests/test_osx_10_12_x86_64.py::TestOSX_10_12::test_all

Check file tests/test_osx_10_12_x86_64.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before ite1cccf2abd2ab7017f2171ac2ae7eacfb3d966fe
Broken version dated2017-04-05
Modulecpuinfo.cpuinfo
Units changed_get_cpu_info_from_sysctl
Fingerprintd2b3672908eaafc6
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in workhorsy/py-cpuinfo