MCPcopy Index your code
hub / github.com/datacamp/pythonwhat / wrapper

Function wrapper

pythonwhat/tasks.py:24–36  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

22
23 @wraps(f)
24 def wrapper(*args, **kwargs):
25 # get bound arguments for call
26 ba = sig.bind_partial(*args, **kwargs)
27 # when process is specified, remove from args and use to execute
28 process = ba.arguments.get("process")
29 if process:
30 ba.arguments["process"] = None
31 # partial function since shell argument may have been left
32 # unspecified, as it will be passed when the process executes
33 pf = partial(wrapper, *ba.args, **ba.kwargs)
34 return process.executeTask(pf)
35 # otherwise, run original function
36 return f(*ba.args, **ba.kwargs)
37
38 return wrapper
39

Callers

nothing calls this directly

Calls 3

fFunction · 0.85
getResultFromProcessFunction · 0.85
executeTaskMethod · 0.45

Tested by

no test coverage detected