From: Michael Tremer Date: Tue, 21 Jul 2026 15:31:42 +0000 (+0200) Subject: cpu: Don't fail if no CPU flags are available X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=HEAD;p=oddments%2Ffireinfo.git cpu: Don't fail if no CPU flags are available Signed-off-by: Michael Tremer --- diff --git a/src/fireinfo/cpu.py b/src/fireinfo/cpu.py index 32a05cd..23a61dc 100644 --- a/src/fireinfo/cpu.py +++ b/src/fireinfo/cpu.py @@ -145,12 +145,13 @@ class CPU(object): """ Return all flags of this CPU. """ - try: - flags = self.__cpuinfo["flags"] - except KeyError: - flags = self.__cpuinfo["Features"] + for field in ("flags", "Features"): + try: + flags = self.__cpuinfo[field] + except KeyError: + continue - return flags.split() + return flags.split() @property def speed(self):