Serhiy Storchaka added the comment: > Since _PyDict_GetItem_KnownHash() may or may not set an exception, we have to > check for a live exception after calling it, and that finds the old exception > of the last attribute lookup and decides that its own lookup failed.
Hmm, with PyDict_GetItem() we don't falsely detect a lookup failing with a live exception set. Is it correct to call _PyType_Lookup() with an exception set? Perhaps we should save a current exception before calling find_name_in_mro() and restore it after. Or raise SystemError if an exception set. Or just add assert(!PyErr_Occurred()) at the begin of find_name_in_mro(). I don't know what is more correct. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue31336> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com