Reputation: 65
I am trying to set a function timeout but, I could not succeed.
I run an Example code from https://docs.python.org/3/library/signal.html?highlight=signal%20sigalrm#example
but, I am getting AttributeError
.
I am using python 3.6.3 on Windows10
Here is my code.
\>>> import signal
\>>> signal.SIGALRM
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'signal' has no attribute 'SIGALRM'
Upvotes: 5
Views: 20853
Reputation: 126
SIGALRM is not supported on Windows. https://docs.python.org/2/library/signal.html On Windows, signal() can only be called with SIGABRT, SIGFPE, SIGILL, SIGINT, SIGSEGV, or SIGTERM. A ValueError will be raised in any other case
Upvotes: 11