An error

AttributeError: module 'signal' has no attribute 'SIGALRM'
Copy the code

why

The Signal module works fine under Linux, but has some limitations under Windows

answer

Docs.python.org/2/library/s…

“On Windows, signal() can only be called with SIGABRT, SIGFPE, SIGILL, SIGINT, SIGSEGV, or SIGTERM. A ValueError will be raised in any other case.”

This means that only one of these signal types is allowed on Windows:

SIGABRT SIGFPE SIGILL SIGINT SIGSEGV SIGTERM

All other errors will be reported if the method does not exist:

AttributeError: module 'signal' has no attribute 'SIGTSTP'
Copy the code