]> git.ipfire.org Git - oddments/fireinfo.git/commitdiff
cpu: Don't fail if no CPU flags are available master
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 21 Jul 2026 15:31:42 +0000 (17:31 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 21 Jul 2026 15:31:42 +0000 (17:31 +0200)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/fireinfo/cpu.py

index 32a05cd4b5f8559d98169f4ceb0a3634f90a693f..23a61dc6c04859ea3c210aba058a9ab855334a6a 100644 (file)
@@ -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):