refactor: fix set_exception for AndStatusWithList
This commit is contained in:
@@ -65,15 +65,20 @@ class AndStatusWithList(DeviceStatus):
|
||||
|
||||
return False
|
||||
|
||||
# TODO Check if this actually works....
|
||||
def set_exception(self, exc):
|
||||
super().set_exception(exc)
|
||||
# Propagate the exception to all sub-statuses that are not done yet.
|
||||
with self._lock:
|
||||
for st in self.all_statuses:
|
||||
with st._lock:
|
||||
if not st.done:
|
||||
st.set_exception(exc)
|
||||
# # TODO Check if this actually works....
|
||||
# def set_exception(self, exc):
|
||||
# # Propagate the exception to all sub-statuses that are not done yet.
|
||||
#
|
||||
# with self._lock:
|
||||
# if self._externally_initiated_completion:
|
||||
# return
|
||||
# if self.done: # Return if status is already done.. It must be resolved already
|
||||
# return
|
||||
# super().set_exception(exc)
|
||||
# for st in self.all_statuses:
|
||||
# with st._lock:
|
||||
# if not st.done:
|
||||
# st.set_exception(exc)
|
||||
|
||||
def _run_callbacks(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user