##// END OF EJS Templates
Fix error in test suite with ip.system()
Thomas Kluyver -
Show More
@@ -2210,7 +2210,7 b' class InteractiveShell(SingletonConfigurable):'
2210 # use piped system by default, because it is better behaved
2210 # use piped system by default, because it is better behaved
2211 system = system_piped
2211 system = system_piped
2212
2212
2213 def getoutput(self, cmd, split=True):
2213 def getoutput(self, cmd, split=True, _depth=0):
2214 """Get output (possibly including stderr) from a subprocess.
2214 """Get output (possibly including stderr) from a subprocess.
2215
2215
2216 Parameters
2216 Parameters
@@ -2229,7 +2229,7 b' class InteractiveShell(SingletonConfigurable):'
2229 if cmd.rstrip().endswith('&'):
2229 if cmd.rstrip().endswith('&'):
2230 # this is *far* from a rigorous test
2230 # this is *far* from a rigorous test
2231 raise OSError("Background processes not supported.")
2231 raise OSError("Background processes not supported.")
2232 out = getoutput(self.var_expand(cmd, depth=1))
2232 out = getoutput(self.var_expand(cmd, depth=_depth+1))
2233 if split:
2233 if split:
2234 out = SList(out.splitlines())
2234 out = SList(out.splitlines())
2235 else:
2235 else:
@@ -98,7 +98,7 b' def xsys(self, cmd):'
98 """
98 """
99 # We use getoutput, but we need to strip it because pexpect captures
99 # We use getoutput, but we need to strip it because pexpect captures
100 # the trailing newline differently from commands.getoutput
100 # the trailing newline differently from commands.getoutput
101 print(self.getoutput(cmd, split=False).rstrip(), end='', file=sys.stdout)
101 print(self.getoutput(cmd, split=False, _depth=1).rstrip(), end='', file=sys.stdout)
102 sys.stdout.flush()
102 sys.stdout.flush()
103
103
104
104
General Comments 0
You need to be logged in to leave comments. Login now