Don't fail in the face of a lacking attribute when wrapping a
function.
This commit is contained in:
parent
81a1fa5c77
commit
8490fab4ad
|
@ -170,6 +170,7 @@ def _write_atomic(path, data):
|
|||
def _wrap(new, old):
|
||||
"""Simple substitute for functools.wraps."""
|
||||
for replace in ['__module__', '__name__', '__qualname__', '__doc__']:
|
||||
if hasattr(old, replace):
|
||||
setattr(new, replace, getattr(old, replace))
|
||||
new.__dict__.update(old.__dict__)
|
||||
|
||||
|
|
Loading…
Reference in New Issue