PEP 678: fix typo in sample code (GH-2762)

This commit is contained in:
Zac Hatfield-Dodds 2022-08-12 02:36:28 -07:00 committed by GitHub
parent 39b78da33b
commit 46178be287
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -247,7 +247,7 @@ exception chaining, and are unnecessary with ``BaseException.add_note()``:
class Explanation(Exception):
def __str__(self):
return "\n" + str(self)
return "\n" + str(self.args[0])
try:
raise AssertionError("Failed!")