quemb.shared.helper.register_clean_exit

quemb.shared.helper.register_clean_exit(func, /, *args, **kwargs)

Execute a function upon clean exits.

Does the same as atexit.register(), but only executes the function if a clean exit happened. The function is not executed if the program terminates with an error. Can be used as a decorator.

Return type:

Callable[[ParamSpec(_P, bound= None)], TypeVar(_T)]