This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2010年02月05日 17:02 by flox, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Messages (11) | |||
|---|---|---|---|
| msg98882 - (view) | Author: Florent Xicluna (flox) * (Python committer) | Date: 2010年02月05日 17:02 | |
It would be useful to get the actual exception in order to introspect its attributes. (See some potential uses in "test_dict") |
|||
| msg98883 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年02月05日 17:03 | |
You can't get the exception before it is even raised... |
|||
| msg98884 - (view) | Author: Florent Xicluna (flox) * (Python committer) | Date: 2010年02月05日 17:09 | |
right, but it could return a wrapper object which receives the exception on __exit__. |
|||
| msg98886 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年02月05日 17:15 | |
Indeed. In that case, I am all for it. |
|||
| msg98889 - (view) | Author: Raymond Hettinger (rhettinger) * (Python committer) | Date: 2010年02月05日 17:43 | |
Too clever by far. |
|||
| msg98930 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2010年02月06日 02:23 | |
I'd prefer for the magic context manager to be returned. |
|||
| msg98985 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2010年02月07日 09:12 | |
Why not the un-magic context manager, which has an exc_value attribute with the exception? |
|||
| msg99004 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2010年02月07日 15:21 | |
2010年2月7日 Georg Brandl <report@bugs.python.org>: > > Georg Brandl <georg@python.org> added the comment: > > Why not the un-magic context manager, which has an exc_value attribute with the exception? That's what I meant, but our perceptions of magic are clearly different. :) |
|||
| msg99006 - (view) | Author: Michael Foord (michael.foord) * (Python committer) | Date: 2010年02月07日 16:52 | |
Just use the context manager and the exception is available as exc_value. |
|||
| msg99008 - (view) | Author: Florent Xicluna (flox) * (Python committer) | Date: 2010年02月07日 18:29 | |
Thank you for this answer. The "exception" argument could be useful. But it does not work as documented on r77999... Btw, the documentation explains the behaviour I expect... |
|||
| msg99009 - (view) | Author: Florent Xicluna (flox) * (Python committer) | Date: 2010年02月07日 18:50 | |
Fixed (with tests) in r78094. Thank you Michael. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:57 | admin | set | github: 52107 |
| 2010年02月07日 18:50:10 | flox | set | messages: + msg99009 |
| 2010年02月07日 18:49:36 | michael.foord | set | status: pending -> closed |
| 2010年02月07日 18:29:56 | flox | set | status: closed -> pending messages: + msg99008 |
| 2010年02月07日 16:52:48 | michael.foord | set | status: open -> closed nosy: + michael.foord messages: + msg99006 resolution: rejected stage: needs patch -> resolved |
| 2010年02月07日 15:21:21 | benjamin.peterson | set | messages: + msg99004 |
| 2010年02月07日 09:12:42 | georg.brandl | set | nosy:
+ georg.brandl messages: + msg98985 |
| 2010年02月06日 02:23:24 | benjamin.peterson | set | nosy:
+ benjamin.peterson messages: + msg98930 |
| 2010年02月05日 17:43:07 | rhettinger | set | nosy:
+ rhettinger messages: + msg98889 |
| 2010年02月05日 17:15:12 | pitrou | set | messages: + msg98886 |
| 2010年02月05日 17:14:30 | ezio.melotti | set | nosy:
+ ezio.melotti stage: needs patch |
| 2010年02月05日 17:09:20 | flox | set | messages: + msg98884 |
| 2010年02月05日 17:03:44 | pitrou | set | nosy:
+ pitrou messages: + msg98883 |
| 2010年02月05日 17:02:08 | flox | create | |