mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-30 17:50:46 +00:00
utils/misc: Fix AttributeError in tls_property
Do not assume the value of the property was set before it is deleted.
This commit is contained in:
parent
3e45a2298e
commit
d3ca49f245
@ -842,8 +842,13 @@ class tls_property:
|
||||
def __delete__(self, instance):
|
||||
tls, values = self._get_tls(instance)
|
||||
with self.lock:
|
||||
values.discard(tls.value)
|
||||
del tls.value
|
||||
try:
|
||||
value = tls.value
|
||||
except AttributeError:
|
||||
pass
|
||||
else:
|
||||
values.discard(value)
|
||||
del tls.value
|
||||
|
||||
def _get_tls(self, instance):
|
||||
dct = instance.__dict__
|
||||
|
Loading…
x
Reference in New Issue
Block a user