get_label now accepts integer and has correct return-type

This commit is contained in:
GammaSQ 2018-12-03 15:29:06 +01:00
parent 0b47df2b54
commit 2e637b5631
No known key found for this signature in database
GPG Key ID: D552FD2F98647C64

View File

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