From: Zac Medico Date: Thu, 18 Oct 2012 01:23:11 +0000 (-0700) Subject: PopenProcess: child_watch_add if no pipe_reader X-Git-Tag: v2.2.0_alpha141~18 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b0d85ce135496bb241d2d5714ac330710dfa0b72;p=portage.git PopenProcess: child_watch_add if no pipe_reader --- 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: