##// END OF EJS Templates
Correct stack depth for !system calls...
Thomas Kluyver -
Show More
@@ -2179,7 +2179,7 b' class InteractiveShell(SingletonConfigurable):'
2179 # we explicitly do NOT return the subprocess status code, because
2179 # we explicitly do NOT return the subprocess status code, because
2180 # a non-None value would trigger :func:`sys.displayhook` calls.
2180 # a non-None value would trigger :func:`sys.displayhook` calls.
2181 # Instead, we store the exit_code in user_ns.
2181 # Instead, we store the exit_code in user_ns.
2182 self.user_ns['_exit_code'] = system(self.var_expand(cmd, depth=2))
2182 self.user_ns['_exit_code'] = system(self.var_expand(cmd, depth=1))
2183
2183
2184 def system_raw(self, cmd):
2184 def system_raw(self, cmd):
2185 """Call the given cmd in a subprocess using os.system
2185 """Call the given cmd in a subprocess using os.system
@@ -2189,7 +2189,7 b' class InteractiveShell(SingletonConfigurable):'
2189 cmd : str
2189 cmd : str
2190 Command to execute.
2190 Command to execute.
2191 """
2191 """
2192 cmd = self.var_expand(cmd, depth=2)
2192 cmd = self.var_expand(cmd, depth=1)
2193 # protect os.system from UNC paths on Windows, which it can't handle:
2193 # protect os.system from UNC paths on Windows, which it can't handle:
2194 if sys.platform == 'win32':
2194 if sys.platform == 'win32':
2195 from IPython.utils._process_win32 import AvoidUNCPath
2195 from IPython.utils._process_win32 import AvoidUNCPath
@@ -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=2))
2232 out = getoutput(self.var_expand(cmd, depth=1))
2233 if split:
2233 if split:
2234 out = SList(out.splitlines())
2234 out = SList(out.splitlines())
2235 else:
2235 else:
General Comments 0
You need to be logged in to leave comments. Login now