#8 Warn about bad raise statements

open
nobody
None
5
2002-01-04
2002-01-04
Andrew Bennetts
No

E.g.

"""
class MyError(Exception):
def __init__(self, arg1, arg2):
pass

raise MyError, 'Something broke' # bad
raise MyError, ('Something broke', 'spam') # ok
"""

Will raise a "TypeError: __init__() takes exactly 3
arguments (2 given)" instead of the expected exception.

It'd be nice if PyChecker could give a warning for
this. :)

Thanks. Keep up the good work!

Discussion