> -----Original Message-----
> From: Peter Ingebretson [mailto:pinge...@yahoo.com]
> Sent: 2. desember 2009 20:01
> To: Kristján Valur Jónsson; Richard Tew
> Cc: stackless@stackless.com
> Subject: Re: [Stackless] Exception passing patch
> I considered extending tasklet.raise_exception and
> channel.send_exception to take an optional traceback keyword argument,
> but after reading http://www.python.org/dev/peps/pep-3109/ it seemed
> that supporting passing exception instances was more in line with the
> direction that Python 3.x was heading.

I agree with your use case.
Just today, I was writing python code to wrap and reraise exceptions, albeit 
not having to do with channels

class WrappedException(Exception): pass

...
except Exception:
        raise WrappedException(sys.exc_info())
        
...
except WrappedException, e:
        raise self.wrapped.args[1], None, self.wrapped.args[2]

If your patch doesn't already do so, I'd suggest that send_exception can take 
up to three arguments, with the same semantics as "raise"

Cheers,
K

_______________________________________________
Stackless mailing list
Stackless@stackless.com
http://www.stackless.com/mailman/listinfo/stackless

Reply via email to