Fix Python Signal AttributeError: module ‘signal’ has no attribute ‘SIGALRM’ – Python Tutorial

By | September 2, 2019

We can use python signal to limit the maximum runtime of python function. However, you may find this singal error:

AttributeError: module ‘signal’ has no attribute ‘SIGALRM’. In this tutorial, we will introduce you how to fix this error.

AttributeError - module 'signal' has no attribute 'SIGALRM'

In python 3.5 library.

we can find this sentence:

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

Which means SIGALRM can not be used on windows.

To fix this error, you shoud change your system operation or change the application and do not use python signal library.

Leave a Reply

Your email address will not be published. Required fields are marked *