Chris Jerdonek <chris.jerdo...@gmail.com> added the comment:
Good to hear, Mariusz! And thanks for the report! Also, as discussed above, I'm leaving this issue open (and retitling) until the following more general issue is fixed: try: raise RuntimeError except Exception as exc: print(f'handling: {exc!r}') exc.__context__ = exc raise ValueError # hangs As I mentioned above, I believe this is because _PyErr_SetObject() only checks for cycles that involve the exception being raised. In this case, the cycle involves the exception one further down: ValueError -> RuntimeError -> RuntimeError -> RuntimeError -> ... ---------- title: Exception handling with "await" can hang in Python3.9.0b1 -> exception chain cycles cause hangs (was "Exception handling with "await" can hang in Python3.9.0b1") _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue40696> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com