Issue 2345: Using an exception variable outside an 'except' clause should raise a Py3K warning (original) (raw)

Created on 2008-03-17 18:29 by brett.cannon, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (5)
msg63708 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2008-03-17 18:29
If one tries to use an exception bound to a variable in an 'except' clause it should raise a Py3K warning.
msg66579 - (view) Author: Bruno Gola (brunogola) Date: 2008-05-10 20:01
see http://bugs.python.org/issue2380, I think that it's related. the only reason i see for nested tuples to be valid syntax in an except clause was: x = ValueError y = (TypeError, IndexError) ... except (x, y): ... and this will not be valid in py3k, as noticed here.
msg91340 - (view) Author: Alexandre Vassalotti (alexandre.vassalotti) * (Python committer) Date: 2009-08-06 00:39
Brett, could you provide an example of "an exception bound to a variable"?
msg91341 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2009-08-06 00:50
try: raise Exception("I should not be seen") except Exception, exc: pass print exc
msg104449 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2010-04-28 18:25
I am assuming that this is an unfixed bug that might still be fixed in 2.7 sometime and that it should not be closed yet, so I am just updating the version.
History
Date User Action Args
2022-04-11 14:56:31 admin set github: 46598
2012-07-02 19:24:20 brett.cannon set resolution: out of date -> wont fix
2012-07-02 19:24:13 brett.cannon set status: open -> closedresolution: out of date
2010-04-28 18:25:30 terry.reedy set nosy: + terry.reedymessages: + versions: + Python 2.7, - Python 2.6
2009-08-06 00:50:05 brett.cannon set messages: +
2009-08-06 00:39:04 alexandre.vassalotti set priority: critical -> normalnosy: + alexandre.vassalottimessages: + stage: test needed
2008-05-10 20:01:44 brunogola set nosy: + brunogolamessages: +
2008-03-17 20:12:14 brett.cannon set priority: release blocker -> critical
2008-03-17 18:29:08 brett.cannon create