Karthikeyan Singaravelan <[email protected]> added the comment:
I think the original error has been fixed with issue28919 where the attribute
errors are ignored while copying the functions as suggested by Anthony in
solution 2. So can this issue be closed as outdated to reopen a new one for
using update_wrapper as enhancement or the title can be changed to reflect the
fact that autospec should now use update_wrapper instead of using
_copy_func_details ? Correct me if I am wrong on the workflow to update the
ticket.
Also there doesn't seem to be any test for this that can possibly added.
Current implementation :
def _copy_func_details(func, funcopy):
# we explicitly don't copy func.__dict__ into this copy as it would
# expose original attributes that should be mocked
for attribute in (
'__name__', '__doc__', '__text_signature__',
'__module__', '__defaults__', '__kwdefaults__',
):
try:
setattr(funcopy, attribute, getattr(func, attribute))
except AttributeError:
pass
Thanks
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue32153>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com