Skip to content

Commit

Permalink
Verify name and target attribute requirements before overwriting …
Browse files Browse the repository at this point in the history
…`closure_function.__name__`
  • Loading branch information
shailshouryya committed Dec 31, 2022
1 parent c5d7538 commit e294bf8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/save_thread_result/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit e294bf8

Please sign in to comment.