This commit is contained in:
@@ -68,13 +68,14 @@ def suppress_mca_callbacks(mcs_card: MCSCard, restore_after_timeout: None | floa
|
||||
clear the suppression after the specified time. If None, the original state
|
||||
is not restored.
|
||||
"""
|
||||
mcs_card._omit_mca_callbacks.set() # pylint: disable=protected-access
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
if restore_after_timeout is not None:
|
||||
time.sleep(restore_after_timeout)
|
||||
mcs_card._omit_mca_callbacks.clear() # pylint: disable=protected-access
|
||||
with mcs_card._rlock:
|
||||
mcs_card._omit_mca_callbacks.set() # pylint: disable=protected-access
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
if restore_after_timeout is not None:
|
||||
time.sleep(restore_after_timeout)
|
||||
mcs_card._omit_mca_callbacks.clear() # pylint: disable=protected-access
|
||||
|
||||
|
||||
if TYPE_CHECKING: # pragma: no cover
|
||||
|
||||
Reference in New Issue
Block a user