Jae IL
Jae IL

Reputation: 65

Python Standard Lib, signal :: AttributeError: module 'signal' has no attribute 'SIGALRM'

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

Answers (1)

json
json

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

Related Questions