##// END OF EJS Templates
Unify exit status from system_raw and system_piped
Thomas Kluyver -
Show More
@@ -2239,10 +2239,8 b' class InteractiveShell(SingletonConfigurable):'
2239 cmd = py3compat.unicode_to_str(cmd)
2239 cmd = py3compat.unicode_to_str(cmd)
2240 # Call the cmd using the OS shell, instead of the default /bin/sh, if set.
2240 # Call the cmd using the OS shell, instead of the default /bin/sh, if set.
2241 ec = subprocess.call(cmd, shell=True, executable=os.environ.get('SHELL', None))
2241 ec = subprocess.call(cmd, shell=True, executable=os.environ.get('SHELL', None))
2242 # Returns either the exit code or minus the value of the signal number.
2242 # exit code is positive for program failure, or negative for
2243 # See the docs for subprocess.Popen.returncode .
2243 # terminating signal number.
2244 if ec < 0:
2245 ec = -ec
2246
2244
2247 # We explicitly do NOT return the subprocess status code, because
2245 # We explicitly do NOT return the subprocess status code, because
2248 # a non-None value would trigger :func:`sys.displayhook` calls.
2246 # a non-None value would trigger :func:`sys.displayhook` calls.
@@ -184,6 +184,12 b' class ProcessHandler(object):'
184 child.terminate(force=True)
184 child.terminate(force=True)
185 # add isalive check, to ensure exitstatus is set:
185 # add isalive check, to ensure exitstatus is set:
186 child.isalive()
186 child.isalive()
187
188 # We follow the subprocess pattern, returning either the exit status
189 # as a positive number, or the terminating signal as a negative
190 # number
191 if child.signalstatus is not None:
192 return -child.signalstatus
187 return child.exitstatus
193 return child.exitstatus
188
194
189
195
General Comments 0
You need to be logged in to leave comments. Login now