diff --git a/python/save_thread_result/__init__.py b/python/save_thread_result/__init__.py index 6d6c17e..f09c8b4 100644 --- a/python/save_thread_result/__init__.py +++ b/python/save_thread_result/__init__.py @@ -204,7 +204,8 @@ def closure_function(): # - https://github.com/python/cpython/pull/22357 # - https://github.com/python/cpython/issues/85999 # - https://bugs.python.org/issue41833 - closure_function.__name__ = self.__class__.__name__ + '.' + 'closure_function' + '(' + str(target.__name__) + ')' + if name is None and target is not None: + closure_function.__name__ = self.__class__.__name__ + '.' + 'closure_function' + '(' + str(target.__name__) + ')' super().__init__(group=group, target=closure_function, name=name, daemon=daemon) def __log(self, message):