Skip to content

Commit

Permalink
Replace test_signal_management.py __noop handler with standard defaul…
Browse files Browse the repository at this point in the history
…t_int_handler to match how signals are now handled in Launch

Signed-off-by: Cian Donovan <[email protected]>
  • Loading branch information
ciandonovan committed Apr 24, 2024
1 parent 43115f7 commit ae85f7a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions launch/test/launch/utilities/test_signal_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@


def cap_signals(*signals):
def _noop(*args):
pass

def _decorator(func):
@functools.wraps(func)
def _wrapper(*args, **kwargs):
handlers = {}
try:
for s in signals:
handlers[s] = signal.signal(s, _noop)
handlers[s] = signal.signal(s, signal.default_int_handler)
return func(*args, **kwargs)
except KeyboardInterrupt:
pass
finally:
assert all(signal.signal(s, h) is _noop for s, h in handlers.items())
assert all(signal.signal(s, h) is signal.default_int_handler
for s, h in handlers.items())
return _wrapper

return _decorator
Expand Down

0 comments on commit ae85f7a

Please sign in to comment.