isinstance instead of type
这个提交包含在:
父节点
c0dbf459aa
当前提交
2c836c5adc
@ -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
|
||||
|
正在加载...
在新工单中引用
屏蔽一个用户