core: fix handling numeric label value set

Not sure if it should be supported this way, but surely it shouldn't
throw AttributeError.
This commit is contained in:
Marek Marczykowski-Górecki 2016-02-10 19:26:44 +01:00 committed by Wojtek Porczyk
parent 79a6da1163
commit e3c94f3949

View File

@ -118,7 +118,7 @@ def _setter_label(self, prop, value):
# pylint: disable=unused-argument
if isinstance(value, qubes.Label):
return value
if value.startswith('label-'):
if isinstance(value, basestring) and value.startswith('label-'):
return self.app.labels[int(value.split('-', 1)[1])]
return self.app.get_label(value)