Re: When using a decorator exceptions raised reference the decorator not the function

2014-11-01 Thread Néstor Boscán
So actually what I ended up doing was a function that will return the last tb_next and this will always give me the reference to the py and line number where the exception was raised. Regards, Néstor On Thu, Oct 30, 2014 at 4:42 PM, Néstor Boscán wrote: > Thanks Terry > > Yes both lines where

Re: When using a decorator exceptions raised reference the decorator not the function

2014-10-30 Thread Néstor Boscán
Thanks Terry Yes both lines where in the traceback using tb_next I got what I needed. Regards, Néstor On Thu, Oct 30, 2014 at 1:36 PM, Terry Reedy wrote: > On 10/30/2014 8:33 AM, Néstor Boscán wrote: > > I'm using Python 2.7 and I'm creating a class decorator that extract >> information from

Re: When using a decorator exceptions raised reference the decorator not the function

2014-10-30 Thread Terry Reedy
On 10/30/2014 8:33 AM, Néstor Boscán wrote: I'm using Python 2.7 and I'm creating a class decorator that extract information from exceptions for logging purposes. Everytime an exception is raised from the original function and I extract the origin of the exception with sys.exc_info() I get a re

Re: When using a decorator exceptions raised reference the decorator not the function

2014-10-30 Thread Jean-Michel Pichavant
- Original Message - > From: "Peter Otten" <__pete...@web.de> > To: python-list@python.org > Sent: Thursday, 30 October, 2014 1:45:42 PM > Subject: Re: When using a decorator exceptions raised reference the decorator > not the function > > Néstor Bosc

Re: When using a decorator exceptions raised reference the decorator not the function

2014-10-30 Thread Peter Otten
Néstor Boscán wrote: > I'm using Python 2.7 and I'm creating a class decorator that extract > information from exceptions for logging purposes. > > Everytime an exception is raised from the original function and I extract > the origin of the exception with sys.exc_info() I get a reference to the

When using a decorator exceptions raised reference the decorator not the function

2014-10-30 Thread Néstor Boscán
Hi I'm using Python 2.7 and I'm creating a class decorator that extract information from exceptions for logging purposes. Everytime an exception is raised from the original function and I extract the origin of the exception with sys.exc_info() I get a reference to the line in the decorator where