Skip to content

Commit

Permalink
Use update_wrapper in SyncToAsync.__get__ (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
legau committed Jul 1, 2022
1 parent 6b1222a commit 22c6767
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -11,3 +11,4 @@ __pycache__/
.python-version
.pytest_cache/
.vscode/
.venv
3 changes: 2 additions & 1 deletion asgiref/sync.py
Expand Up @@ -445,7 +445,8 @@ def __get__(self, parent, objtype):
"""
Include self for methods
"""
return functools.partial(self.__call__, parent)
func = functools.partial(self.__call__, parent)
return functools.update_wrapper(func, self.func)

def thread_handler(self, loop, source_task, exc_info, func, *args, **kwargs):
"""
Expand Down

0 comments on commit 22c6767

Please sign in to comment.