Merge remote-tracking branch 'origin/pr/85'

* 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
This commit is contained in:
Marek Marczykowski-Górecki 2018-12-08 12:28:36 +01:00
commit 4a727f1dfa
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -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