New submission from Serhiy Storchaka <storchaka+cpyt...@gmail.com>: The proposed PR adds missed checks for errors and PyErr_Clear() calls in PyImport_Cleanup().
It may be worth to use PyErr_WriteUnraisable() in place of PyErr_Clear() (newly added and existing) in most cases. But this can add an unexpected noise, and I don't wont to do this at this stage of 3.7. It could be done in 3.8 though, and backported to 3.7 later. I'm not sure that PyImport_Cleanup() works properly if sys.modules is not a dict. At this stage a custom mapping will likely be broken when most of modules are destroyed. ---------- components: Interpreter Core messages: 315592 nosy: brett.cannon, eric.snow, ncoghlan, pitrou, serhiy.storchaka, vstinner priority: normal severity: normal status: open title: Better error handling in PyImport_Cleanup() type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33330> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com