mirror of
https://github.com/python/cpython.git
synced 2025-08-20 16:53:19 +00:00
[Bug #1576241] Let functools.wraps work with built-in functions
This commit is contained in:
parent
d2ee30b485
commit
3d6a834e29
3 changed files with 10 additions and 1 deletions
|
@ -32,7 +32,7 @@ def update_wrapper(wrapper,
|
|||
for attr in assigned:
|
||||
setattr(wrapper, attr, getattr(wrapped, attr))
|
||||
for attr in updated:
|
||||
getattr(wrapper, attr).update(getattr(wrapped, attr))
|
||||
getattr(wrapper, attr).update(getattr(wrapped, attr, {}))
|
||||
# Return the wrapper so this can be used as a decorator via partial()
|
||||
return wrapper
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue