Closed
Closed
Copy link
Description
class PurePythonExceptionFormattingMixin:
def get_exception(self, callable, slice_start=0, slice_end=-1):
try:
callable()
self.fail("No exception thrown.")
except:
return traceback.format_exc().splitlines()[slice_start:slice_end]
self.fail
simply raises an exception, so putting it in a try..except is not going to work.
Linked PRs
- gh-125514: fix bug in test_traceback utility. Specify exception types in except: clauses #125516
- [3.13] gh-125514: fix bug in test_traceback utility. Specify exception types in except: clauses (GH-125516) #125524
- [3.12] gh-125514: fix bug in test_traceback utility. Specify exception types in except: clauses (GH-125516) #125525
Metadata
Metadata
Assignees
Labels
only security fixesonly security fixesbugs and security fixesbugs and security fixesbugs and security fixesbugs and security fixes