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:
Marek Marczykowski-Górecki 2016-09-08 04:13:02 +02:00
parent a2d9b15413
commit bb78eb1ce6
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -274,7 +274,7 @@ class property(object): # pylint: disable=redefined-builtin,invalid-name
self._enforce_write_once(instance)
try:
oldvalue = getattr(instance, self.__name__)
oldvalue = getattr(instance, self._attr_name)
has_oldvalue = True
except AttributeError:
has_oldvalue = False