aboutsummaryrefslogtreecommitdiffstats
path: root/selftest/process_test/foo.py
diff options
context:
space:
mode:
Diffstat (limited to 'selftest/process_test/foo.py')
-rwxr-xr-xselftest/process_test/foo.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/selftest/process_test/foo.py b/selftest/process_test/foo.py
index 4abe887..0931c9b 100755
--- a/selftest/process_test/foo.py
+++ b/selftest/process_test/foo.py
@@ -3,7 +3,13 @@
import sys
import atexit
import time
+import signal
+def signal_handler(sig, frame):
+ print('SIGINT received')
+ sys.exit(42)
+
+signal.signal(signal.SIGINT, signal_handler)
sys.stdout.write('foo stdout\n')
sys.stderr.write('foo stderr\n')