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 pass
# then search for index # then search for index
if label.isdigit(): if type(label) == int or label.isdigit():
for i in self.labels: return self.labels.values[int(label)]
if i.index == int(label):
return i
raise KeyError(label) raise KeyError(label)