meld r1311 - trunk



Author: vincele
Date: Mon Mar 30 21:15:31 2009
New Revision: 1311
URL: http://svn.gnome.org/viewvc/meld?rev=1311&view=rev

Log:
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...


Modified:
   trunk/misc.py

Modified: trunk/misc.py
==============================================================================
--- trunk/misc.py	(original)
+++ trunk/misc.py	Mon Mar 30 21:15:31 2009
@@ -181,6 +181,8 @@
     If 'workdir' is specified the command is run from that directory.
     """
     class sentinel(object):
+        def __init__(self):
+            self.pipe = None
         def __del__(self):
             if self.pipe:
                 errorstream.write("killing '%s' with pid '%i'\n" % (command[0], self.pipe.pid))



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