Ezio Melotti added the comment: Thanks for the patch, however I don't think this is a robust solution. Other objects might have undeletable attributes too.
The current code can delete an attribute without restoring it so an easy solution would be removing the hasattr() check, but that seems to be there to deal with proxy objects, so doing that will probably break them (Lib/unittest/test/testmock/testpatch.py:821 seems to test proxy object). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22138> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com