diff --git a/IPython/Extensions/ipipe.py b/IPython/Extensions/ipipe.py index 7b9b37d..dc2b860 100644 --- a/IPython/Extensions/ipipe.py +++ b/IPython/Extensions/ipipe.py @@ -1301,19 +1301,20 @@ class ix(Table): """ def __init__(self, cmd): self.cmd = cmd - self._pipe = None + self._pipeout = None - def __xiter__(self, mode): - self._pipe = os.popen(self.cmd) - for l in self._pipe: + def __xiter__(self, mode="default"): + (_pipein, self._pipeout) = os.popen4(self.cmd) + _pipein.close() + for l in self._pipeout: yield l.rstrip("\r\n") - self._pipe.close() - self._pipe = None + self._pipeout.close() + self._pipeout = None def __del__(self): - if self._pipe is not None and not self._pipe.closed: - self._pipe.close() - self._pipe = None + if self._pipeout is not None and not self._pipeout.closed: + self._pipeout.close() + self._pipeout = None def __xrepr__(self, mode): if mode == "header" or mode == "footer": diff --git a/doc/ChangeLog b/doc/ChangeLog index 3c4af84..83275d6 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2006-07-14 Walter Doerwald + + * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the + error output of the running command doesn't mess up the screen. + 2006-07-13 Walter Doerwald * IPython/Extensions/ipipe.py (isort): Make isort usable without