Xinmeng Xia <xi...@smail.nju.edu.cn> added the comment:
Thanks for your kind explanation! My description is a little confusing. Sorry about that. The problem here is that the program should stop when the exception is caught whatever the exception is. (I think bpo-25612 (#1773) fixed exception selection problems and right exception can be caught) The fact is this program will fall into an infinite loop. Error messages are printed in a dead loop. The program doesn't stop. This is not normal. There will be no loops in Python 3.5 and 3.6 (Attached output in Python 3.5 and 3.6). Output on Python 3.5,3.6 (all errors are printed without any loop ) ----------------------------------------------------- Exception ignored in: <generator object foo at 0x7f4cde5b8b48> RuntimeError: generator ignored GeneratorExit Traceback (most recent call last): File "/home/xxm/Desktop/nameChanging/report/test1.py", line 248, in <module> print(i) NameError: name 'i' is not defined Exception ignored in: <generator object foo at 0x7f4cde5b8bf8> RuntimeError: generator ignored GeneratorExit Exception ignored in: <generator object foo at 0x7f4cde5b8ca8> RuntimeError: generator ignored GeneratorExit -------------------------------------------------------- ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue42762> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com