Prasad, Ramit wrote:
>> Prasad, Ramit wrote:
>>
>> > So I have a context manager used to catch errors
>> >
>> > def __exit__( self, exceptionClass, exception, tracebackObject ):
>> > if isinstance( exception, self.exceptionClasses ):
>> > #do something here
>> >
>> > Normally excepti
On Thu, Mar 15, 2012 at 2:25 PM, Prasad, Ramit
wrote:
>> > ...
>> > (, "'A' object has no attribute 'x'",
>> )
>> > AttributeError: 'A' object has no attribute 'x'
>> >
>> > As you can see, I am getting a string while you are not.
>>
>>Ian Kelly said:
>> Looks like a version difference. I don't h
> > ...
> > (, "'A' object has no attribute 'x'",
> )
> > AttributeError: 'A' object has no attribute 'x'
> >
> > As you can see, I am getting a string while you are not.
>
>Ian Kelly said:
> Looks like a version difference. I don't have Python 2.6 handy to
> test on, but I get a str in Python 2
On Thu, Mar 15, 2012 at 1:10 PM, Prasad, Ramit
wrote:
>> Prasad, Ramit wrote:
>>
>> > So I have a context manager used to catch errors
>> >
>> > def __exit__( self, exceptionClass, exception, tracebackObject ):
>> > if isinstance( exception, self.exceptionClasses ):
>> > #do something
> Prasad, Ramit wrote:
>
> > So I have a context manager used to catch errors
> >
> > def __exit__( self, exceptionClass, exception, tracebackObject ):
> > if isinstance( exception, self.exceptionClasses ):
> > #do something here
> >
> > Normally exception would be the exception insta
Prasad, Ramit wrote:
> So I have a context manager used to catch errors
>
> def __exit__( self, exceptionClass, exception, tracebackObject ):
> if isinstance( exception, self.exceptionClasses ):
> #do something here
>
> Normally exception would be the exception instance, but for
> A
So I have a context manager used to catch errors
def __exit__( self, exceptionClass, exception, tracebackObject ):
if isinstance( exception, self.exceptionClasses ):
#do something here
Normally exception would be the exception instance, but for
AttributeError it seems to be a string