Apr-09-2018, 07:08 PM
Please show your code. Or double check that you didn't name any of your files
Per the docs, that should work:
signal.py
, which would override the builtin module.Per the docs, that should work:
https://docs.python.org/3/library/signal.html#example Wrote:import signal, os def handler(signum, frame): print('Signal handler called with signal', signum) raise OSError("Couldn't open device!") # Set the signal handler and a 5-second alarm signal.signal(signal.SIGALRM, handler) signal.alarm(5) # This open() may hang indefinitely fd = os.open('/dev/ttyS0', os.O_RDWR) signal.alarm(0) # Disable the alarm