[Bug #1576241] Let functools.wraps work with built-in functions

This commit is contained in:
Andrew M. Kuchling 2006-10-27 16:39:10 +00:00
parent d3aad0199e
commit 41eb7164df
2 changed files with 8 additions and 1 deletions

View file

@ -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