mirror of
https://github.com/python/cpython.git
synced 2025-09-11 19:27:07 +00:00
Fix contextlib not copying function attributes
This commit is contained in:
parent
d207b4f376
commit
35fd142435
2 changed files with 16 additions and 0 deletions
|
@ -78,6 +78,7 @@ def contextmanager(func):
|
|||
try:
|
||||
helper.__name__ = func.__name__
|
||||
helper.__doc__ = func.__doc__
|
||||
helper.__dict__ = func.__dict__
|
||||
except:
|
||||
pass
|
||||
return helper
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue