Issue 13767: Would be nice to have a future import that turned off old except style (original) (raw)
Issue13767
Created on 2012-01-11 13:24 by Zaheer.Merali, last changed 2022-04-11 14:57 by admin. This issue is now closed.
Messages (3) | ||
---|---|---|
msg151058 - (view) | Author: Zaheer Merali (Zaheer.Merali) | Date: 2012-01-11 13:24 |
It would be nice to have a future import to be able to prevent people in code doing: try: .... except Exception, e: .... and make people do: try: .... except Exception as e: .... | ||
msg151059 - (view) | Author: Ezio Melotti (ezio.melotti) * ![]() |
Date: 2012-01-11 14:00 |
If you run python with the -3 flag you should get a warning about that. If you combine it with -We you should be able to get an error instead of a warning. Note however that both the flags are not specific for the "except" but also generate/affect other warnings as well. | ||
msg151060 - (view) | Author: Benjamin Peterson (benjamin.peterson) * ![]() |
Date: 2012-01-11 14:05 |
Unfortunately, that would be a new feature, so it is not acceptable to Python 2.7. |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:57:25 | admin | set | github: 57976 |
2012-01-11 14:05:38 | benjamin.peterson | set | status: open -> closednosy: + benjamin.petersonmessages: + resolution: rejected |
2012-01-11 14:00:30 | ezio.melotti | set | nosy: + ezio.melottimessages: + |
2012-01-11 13:24:51 | Zaheer.Merali | create |