Skip to content

Commit

Permalink
Fix error in test suite with ip.system()
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Jun 10, 2012
1 parent 6ac7e02 commit d3c023e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions IPython/core/interactiveshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -2210,7 +2210,7 @@ def system_raw(self, cmd):
# use piped system by default, because it is better behaved
system = system_piped

def getoutput(self, cmd, split=True):
def getoutput(self, cmd, split=True, _depth=0):
"""Get output (possibly including stderr) from a subprocess.
Parameters
Expand All @@ -2229,7 +2229,7 @@ def getoutput(self, cmd, split=True):
if cmd.rstrip().endswith('&'):
# this is *far* from a rigorous test
raise OSError("Background processes not supported.")
out = getoutput(self.var_expand(cmd, depth=1))
out = getoutput(self.var_expand(cmd, depth=_depth+1))
if split:
out = SList(out.splitlines())
else:
Expand Down
2 changes: 1 addition & 1 deletion IPython/testing/globalipapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def xsys(self, cmd):
"""
# We use getoutput, but we need to strip it because pexpect captures
# the trailing newline differently from commands.getoutput
print(self.getoutput(cmd, split=False).rstrip(), end='', file=sys.stdout)
print(self.getoutput(cmd, split=False, _depth=1).rstrip(), end='', file=sys.stdout)
sys.stdout.flush()


Expand Down

0 comments on commit d3c023e

Please sign in to comment.