mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +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,7 +842,12 @@ class tls_property:
|
|||||||
def __delete__(self, instance):
|
def __delete__(self, instance):
|
||||||
tls, values = self._get_tls(instance)
|
tls, values = self._get_tls(instance)
|
||||||
with self.lock:
|
with self.lock:
|
||||||
values.discard(tls.value)
|
try:
|
||||||
|
value = tls.value
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
values.discard(value)
|
||||||
del tls.value
|
del tls.value
|
||||||
|
|
||||||
def _get_tls(self, instance):
|
def _get_tls(self, instance):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user