isinstance instead of type
This commit is contained in:
parent
c0dbf459aa
commit
2c836c5adc
@ -216,11 +216,10 @@ class QubesBase(qubesadmin.base.PropertyHolder):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
# then search for index
|
# then search for index
|
||||||
if type(label) == int or label.isdigit():
|
if isinstance(label, int) or label.isdigit():
|
||||||
for i in self.labels.values():
|
for i in self.labels.values():
|
||||||
if i.index == int(label):
|
if i.index == int(label):
|
||||||
return i
|
return i
|
||||||
|
|
||||||
raise KeyError(label)
|
raise KeyError(label)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
Loading…
Reference in New Issue
Block a user