mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Add a custom __str__ method to KeyError that applies repr() to the
missing key. (Also added a guard to SyntaxError__str__ to prevent calling PyString_Check(NULL).)
This commit is contained in:
parent
99dba27e9a
commit
602d45194c
2 changed files with 41 additions and 3 deletions
|
@ -10,7 +10,7 @@ spam
|
|||
ImportError
|
||||
spam
|
||||
IndexError
|
||||
spam
|
||||
'spam'
|
||||
KeyError
|
||||
spam
|
||||
KeyboardInterrupt
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue