From 11937db0fb2e25a30d855b084417f8d52547ff54 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 14 Feb 2012 15:39:57 -0800 Subject: [PATCH] Assert that fork returns int for bug 403697. These cases should have been included with commit 6a94a074aa0475173a51f3f726377d4c407e986b. --- pym/_emerge/EbuildFetcher.py | 3 +++ pym/portage/dbapi/_MergeProcess.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/pym/_emerge/EbuildFetcher.py b/pym/_emerge/EbuildFetcher.py index 6ad434129..c0175b3fb 100644 --- a/pym/_emerge/EbuildFetcher.py +++ b/pym/_emerge/EbuildFetcher.py @@ -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] diff --git a/pym/portage/dbapi/_MergeProcess.py b/pym/portage/dbapi/_MergeProcess.py index cf5926529..1747a098b 100644 --- a/pym/portage/dbapi/_MergeProcess.py +++ b/pym/portage/dbapi/_MergeProcess.py @@ -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 = "" -- 2.26.2