qubes: fix resetting already default property
`getattr(instance, self.__name__)` always succeed if attribute has default value. This results in deleting attribute even when it isn't set.
This commit is contained in:
parent
a2d9b15413
commit
bb78eb1ce6
@ -274,7 +274,7 @@ class property(object): # pylint: disable=redefined-builtin,invalid-name
|
|||||||
self._enforce_write_once(instance)
|
self._enforce_write_once(instance)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
oldvalue = getattr(instance, self.__name__)
|
oldvalue = getattr(instance, self._attr_name)
|
||||||
has_oldvalue = True
|
has_oldvalue = True
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
has_oldvalue = False
|
has_oldvalue = False
|
||||||
|
Loading…
Reference in New Issue
Block a user