MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / wrapper

Function wrapper

tests/ci_use/iluvatar_UT/utils.py:11–21  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

9
10 @functools.wraps(func)
11 def wrapper(*args, **kwargs):
12 original_handler = signal.signal(signal.SIGALRM, _handle_timeout)
13 signal.alarm(seconds)
14
15 try:
16 result = func(*args, **kwargs)
17 signal.alarm(0)
18 return result
19 finally:
20 signal.signal(signal.SIGALRM, original_handler)
21 signal.alarm(0)
22
23 return wrapper
24

Callers

nothing calls this directly

Calls 1

funcFunction · 0.85

Tested by

no test coverage detected