Permalink
Browse files

Correct exit code from os.system() on Unix.

Closes gh-2794
  • Loading branch information...
1 parent f7c540b commit 818ae353031fabb6e6d78f8bed79a2c6051715d1 @takluyver committed Jan 17, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 IPython/core/interactiveshell.py
@@ -2246,6 +2246,10 @@ def system_raw(self, cmd):
else:
cmd = py3compat.unicode_to_str(cmd)
ec = os.system(cmd)
+ # The high byte is the exit code, the low byte is a signal number
+ # that we discard for now. See the docs for os.wait()
+ if ec > 255:
+ ec >>= 8
# We explicitly do NOT return the subprocess status code, because
# a non-None value would trigger :func:`sys.displayhook` calls.

0 comments on commit 818ae35

Please sign in to comment.