Fix SubProcess._poll to handle a missing pid gracefully.
authorZac Medico <zmedico@gentoo.org>
Wed, 9 Jul 2008 12:03:53 +0000 (12:03 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 9 Jul 2008 12:03:53 +0000 (12:03 -0000)
svn path=/main/trunk/; revision=10998

pym/_emerge/__init__.py

index 1c652e69181d97021a438ca10763d91793585f8a..a696e5c2b23023bf8ce396eaf4eb87ab106e0f83 100644 (file)
@@ -1703,6 +1703,8 @@ class SubProcess(AsynchronousTask):
        def _poll(self):
                if self.returncode is not None:
                        return self.returncode
+               if self.pid is None:
+                       return self.returncode
                retval = os.waitpid(self.pid, os.WNOHANG)
                if retval == (0, 0):
                        return None