浏览代码

reverted to comparing .index

GammaSQ 5 年之前
父节点
当前提交
aebc944704
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      qubesadmin/app.py

+ 3 - 1
qubesadmin/app.py

@@ -217,7 +217,9 @@ class QubesBase(qubesadmin.base.PropertyHolder):
 
         # then search for index
         if type(label) == int or label.isdigit():
-            return self.labels.values()[int(label)]
+            for i in self.labels.values():
+                if i.index == int(label):
+                    return i
 
         raise KeyError(label)