Kevin Jacobs <[EMAIL PROTECTED]> wrote:
> On 7/21/06, *Nick Coghlan* <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
>     Delaney, Timothy (Tim) wrote:
>      > Looks like there's a bug in Popen.__del__ in 2.5. I'm not in a
>     position
>      > to have a look right now.
> 
>     For those not watching python-checkins, a check for "is not None"
>     has been
>     added before the offending line in Popen.__del__. (by Georg, IIRC)
> 
> 
> Many thanks for accepting my patch.  There remains a potentially related 
> problem in popen2.py, but it may be a lower priority, since most folks 
> should be using subprocess.
> 
>     def __del__(self):
>         # In case the child hasn't been waited on, check if it's done.
>         self.poll(_deadstate=sys.maxint)
>         if self.sts < 0:
>             if _active:
>                 # Child is still running, keep us alive until we can 
> wait on it.
>                 _active.append(self)
> 
> 
> The is _active check, unless it intendeds to check for either empty or 
> None, should probably be revised to:
> 
>     def __del__(self):
>         # In case the child hasn't been waited on, check if it's done.
>         self.poll(_deadstate=sys.maxint)
>         if self.sts < 0:
>             if _active is None:
>                 # Child is still running, keep us alive until we can 
> wait on it.
>                 _active.append(self)
> 
> However, there may be a clever reason for doing what is doing that I do 
> not see.

There's no reason (I know since I added the check myself ;). Thanks
for pointing out that obvious bug. (fixed in rev 50759).

Georg

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to