Assert that fork returns int for bug 403697.
authorZac Medico <zmedico@gentoo.org>
Tue, 14 Feb 2012 23:39:57 +0000 (15:39 -0800)
committerZac Medico <zmedico@gentoo.org>
Tue, 14 Feb 2012 23:39:57 +0000 (15:39 -0800)
These cases should have been included with commit
6a94a074aa0475173a51f3f726377d4c407e986b.

pym/_emerge/EbuildFetcher.py
pym/portage/dbapi/_MergeProcess.py

index 6ad434129b85cde294a65dace61ccae76bbe519c..c0175b3fbaa1a7574558ed3fd5c5e31519c059cc 100644 (file)
@@ -164,6 +164,9 @@ class EbuildFetcher(SpawnProcess):
 
                pid = os.fork()
                if pid != 0:
+                       if not isinstance(pid, int):
+                               raise AssertionError(
+                                       "fork returned non-integer: %s" % (repr(pid),))
                        portage.process.spawned_pids.append(pid)
                        return [pid]
 
index cf59265295274b70fc54f440de685dd2ee4ee840..1747a098bcf37e9f02dbb84897d25a0d8d33896d 100644 (file)
@@ -129,6 +129,10 @@ class MergeProcess(SpawnProcess):
 
                pid = os.fork()
                if pid != 0:
+                       if not isinstance(pid, int):
+                               raise AssertionError(
+                                       "fork returned non-integer: %s" % (repr(pid),))
+
                        os.close(elog_writer_fd)
                        self._elog_reader_fd = elog_reader_fd
                        self._buf = ""