From b0d85ce135496bb241d2d5714ac330710dfa0b72 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 17 Oct 2012 18:23:11 -0700 Subject: [PATCH] PopenProcess: child_watch_add if no pipe_reader --- pym/portage/util/_async/PopenProcess.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pym/portage/util/_async/PopenProcess.py b/pym/portage/util/_async/PopenProcess.py index 37d32f260..2fc56d295 100644 --- a/pym/portage/util/_async/PopenProcess.py +++ b/pym/portage/util/_async/PopenProcess.py @@ -7,13 +7,15 @@ class PopenProcess(SubProcess): __slots__ = ("pipe_reader", "proc",) - def __init__(self, **kwargs): - SubProcess.__init__(self, **kwargs) + def _start(self): + self.pid = self.proc.pid self._registered = True - def _start(self): - if self.pipe_reader is not None: + if self.pipe_reader is None: + self._reg_id = self.scheduler.child_watch_add( + self.pid, self._child_watch_cb) + else: try: self.pipe_reader.scheduler = self.scheduler except AttributeError: -- 2.26.2