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) 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