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.
jumpserver/apps/common/utils/inspect.py

11 lines
237 B

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