超时信号处理函数
(signum, frame)
| 8 | |
| 9 | # 定义 with_timeout 装饰器 |
| 10 | def timeout_handler(signum, frame): |
| 11 | """超时信号处理函数""" |
| 12 | raise TimeoutError("操作超时") |
| 13 | |
| 14 | def with_timeout(timeout_param=None, default_seconds=300): |
| 15 | """函数超时装饰器 |
nothing calls this directly
no outgoing calls
no test coverage detected