del of exception causes Exception
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Pyflakes |
Fix Released
|
Critical
|
Phil Frost |
Bug Description
The following code causes an exception
try:
pass
except Exception as e:
del e
$ python3.4 -m pyflakes test_del_
Traceback (most recent call last):
File "/usr/lib64/
"__main__", mod_spec)
File "/usr/lib64/
exec(code, run_globals)
File "/usr/lib/
main(
File "/usr/lib/
warnings = checkRecursive(
File "/usr/lib/
warnings += checkPath(
File "/usr/lib/
return check(codestr, filename, reporter)
File "/usr/lib/
w = checker.
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
handler(node)
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
handler(node)
File "/usr/lib/
del self.scope[
KeyError: 'e'
This was introduced in 1.2.0 with https:/
Changed in pyflakes: | |
importance: | Undecided → Critical |
status: | New → Confirmed |
Changed in pyflakes: | |
status: | In Progress → Fix Committed |
Changed in pyflakes: | |
status: | Fix Committed → Fix Released |
Looks like this happens with Python 3 only.