mirror of
https://github.com/python/cpython.git
synced 2025-09-14 20:56:06 +00:00
Disallow keyword args for exceptions.
This commit is contained in:
parent
008b861bf0
commit
861089fc49
2 changed files with 10 additions and 0 deletions
|
@ -296,3 +296,10 @@ for args in exceptionList:
|
|||
( repr(e), checkArgName,
|
||||
repr(expected[checkArgName]),
|
||||
repr(getattr(e, checkArgName)) ))
|
||||
|
||||
try:
|
||||
BaseException(a=1)
|
||||
except TypeErrror:
|
||||
pass
|
||||
else:
|
||||
raise TestFailed("BaseException shouldn't take keyword args")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue