* origin/pr/85: isinstance instead of type reverted to comparing .index forgot braces forgot braces get_label now accepts integer and has correct return-type
@@ -221,11 +221,10 @@ class QubesBase(qubesadmin.base.PropertyHolder):
pass
# then search for index
- if label.isdigit():
- for i in self.labels:
+ if isinstance(label, int) or label.isdigit():
+ for i in self.labels.values():
if i.index == int(label):
return i
-
raise KeyError(label)
@staticmethod