Fix AsynchronousTask.removeStartListener() and removeExitListener() to return
authorZac Medico <zmedico@gentoo.org>
Sun, 27 Jul 2008 01:31:33 +0000 (01:31 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 27 Jul 2008 01:31:33 +0000 (01:31 -0000)
early if there are no listeners.

svn path=/main/trunk/; revision=11202

pym/_emerge/__init__.py

index cc7191ba404f15c25f7569bcc24fb9ea82b1baea..fb3bd1e351dd4b0e817474f68fa4550bb9303b0f 100644 (file)
@@ -1642,6 +1642,8 @@ class AsynchronousTask(SlotObject):
                self._start_listeners.append(f)
 
        def removeStartListener(self, f):
+               if self._start_listeners is None:
+                       return
                self._start_listeners.remove(f)
 
        def _start_hook(self):
@@ -1661,6 +1663,8 @@ class AsynchronousTask(SlotObject):
                self._exit_listeners.append(f)
 
        def removeExitListener(self, f):
+               if self._exit_listeners is None:
+                       return
                self._exit_listeners.remove(f)
 
        def _wait_hook(self):