I'm looking at this minimal valid(?) program:
import sys
def f():
try:
raise Exception()
except Exception:
raise Exception(), None, sys.exc_info()[2]
f()
This program executes and behaves as expected , preserving the stack trace of the inner exception, as documented by help("raise")
. However, when I run pylint
on it, this is what I get:
$ pylint program.py
************* Module tmp
E: 7, 0: invalid syntax (<string>, line 7) (syntax-error)
The syntax-error disappears when I remove the second and third expressions to raise
.
Is this a bug in pylint, or am I overlooking something?