]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-98458: unittest: bugfix for infinite loop while handling chained exceptions that...
authorAlexTate <0xalextate@gmail.com>
Sun, 4 Dec 2022 19:37:55 +0000 (12:37 -0700)
committerGitHub <noreply@github.com>
Sun, 4 Dec 2022 19:37:55 +0000 (11:37 -0800)
commit72ec518203c3f3577a5e888b12f10bb49060e6c2
tree08f93da53cbb5efaeaefce304798548a97c686fa
parent1012dc1b4367e05b92d67ea6925a39d50dce31b7
gh-98458: unittest: bugfix for infinite loop while handling chained exceptions that contain cycles (#98459)

* Bugfix addressing infinite loop while handling self-referencing chained exception in TestResult._clean_tracebacks()
* Bugfix extended to properly handle exception cycles in _clean_tracebacks. The "seen" set follows the approach used in the TracebackException class (thank you @iritkatriel for pointing it out)
* adds a test for a single chained exception that holds a self-loop in its __cause__ and __context__ attributes
Lib/test/test_unittest/test_result.py
Lib/unittest/result.py
Misc/NEWS.d/next/Library/2022-10-19-18-31-53.gh-issue-98458.vwyq7O.rst [new file with mode: 0644]