isinstance instead of type

This commit is contained in:
GammaSQ 2018-12-08 12:00:15 +01:00
parent c0dbf459aa
commit 2c836c5adc
No known key found for this signature in database
GPG Key ID: D552FD2F98647C64

View File

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