On Wed, Apr 08, 2009 at 04:16:59PM -0700, Danek Duvall wrote:
> On Wed, Apr 08, 2009 at 04:03:08PM -0700, [email protected] wrote:
> 
> > On Wed, Apr 08, 2009 at 03:47:27PM -0700, Danek Duvall wrote:
> > > An updated webrev is available at
> > > 
> > >     http://cr.opensolaris.org/~dduvall/pkg-memoryerror2/
> > 
> > client.py:
> > 
> >   - line 2522: Would we ever get an OSError that doesn't have errno as
> >     an attribute?  I'm trying to understand if it's safe to assume that
> >     a MemoryError is any exception in this part of the code without
> >     errno as an attribute.
> 
> It probably is.  You think I should test for isinstance(__e, OSError)
> rather than hasattr(__e, "errno")?  I'm pretty sure the former would work,
> but the latter seems more obviously correct.

I guess I was concerned about the case where you get an OSError that
doesn't have the errno attribute.  You'd probably want to re-raise that
error, but not a MemoryError.  According to the EnvironmentError
exception's description, it's possible that errno won't be set.

        http://www.python.org/doc/2.4.4/lib/module-exceptions.html

I think you probably want to check that errno is an attribute and that
the exception is a subclass of EnvironmentError.

-j
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to