C02TPARXG8WN:fal$ python
Python 3.6.9 (default,Nov 10 2019,01:00:31)
[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.10.44.4)] on darwin
Type "help","copyright","credits" or "license" for more information.
>>> import signal
>>> signal.SIGHUP
Traceback (most recent call last):
File "<stdin>",line 1,in <module>
AttributeError: module 'signal' has no attribute 'SIGHUP'
>>>
在macOS上的测试信号。无法弄清楚为什么持续出现吸气信号错误
C02TPARXG8WN:~ fc$ trap -l
1)SIGHUP 2)SIGINT 3)SIGQUIT 4)SIGILL 5)SIGTRAP 6)SIGABRT 7)SIGEMT 8)SIGFPE 9)SIGKILL 10)SIGBUS 11)SIGSEGV 12)SIGSYS 13)SIGPIPE 14)SIGALRM 15)SIGTERM 16)SIGURG 17)SIGSTOP 18)SIGTSTP 19)SIGCONT 20)SIGCHLD 21)SIGTTIN 22)SIGTTOU 23)SIGIO 24)SIGXCPU 25)SIGXFSZ 26)SIGVTALRM 27)SIGPROF 28)SIGWINCH 29)SIGINFO 30)SIGUSR1 31)SIGUSR2
在我的系统中,“陷阱-l”显示了对信号的选择