On Dec 31 2009, 4:30 pm, Steven D'Aprano <st...@remove-this-
cybersource.com.au> wrote:

> ...     1/0
> ... except ZeroDivisionError, e:
> ...     e.args = e.args + ('fe', 'fi', 'fo', 'fum')
> ...     raise

When I added print e.args it showed the old args. Maybe I was trying
too hard - this is why I said e seemed locked or something.

This started working:

            new_exception = self.format_fault(e.args[0])
            e.args = (new_exception,) + (e.args[1:])
            raise

May I ask if args always has more than one entry? I need to bypass the
silly "'tuple' object does not support item assignment" issue...
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to