Re: [PATCH] define self.pipe in a new __init__ method



On Fri, Mar 27, 2009 at 11:07 AM, Vincent Legoll
<vincent legoll gmail com> wrote:
> The sentinel class in misc.py does not define self.pipe
> in its constructor (because there's none) but that
> variable is used in the __del__ method.
>
> This is currently not a problem since the way this inner
> class is used is to always call __call__ immediately
> after having created an instance, but I think we should
> still do the safe thing...

It wasn't even safe wrt exceptions, c.f.:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=471297
Exception exceptions.AttributeError: "'sentinel' object has no
attribute 'pipe'" in <bound method sentinel.__del__ of [...]

-- 
Vincent Legoll


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]