mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
237 B
11 lines
237 B
4 years ago
|
import inspect
|
||
|
|
||
|
|
||
|
def copy_function_args(func, locals_dict: dict):
|
||
|
signature = inspect.signature(func)
|
||
|
keys = signature.parameters.keys()
|
||
|
kwargs = {}
|
||
|
for k in keys:
|
||
|
kwargs[k] = locals_dict.get(k)
|
||
|
return kwargs
|