Show More
@@ -2246,6 +2246,10 b' class InteractiveShell(SingletonConfigurable):' | |||||
2246 | else: |
|
2246 | else: | |
2247 | cmd = py3compat.unicode_to_str(cmd) |
|
2247 | cmd = py3compat.unicode_to_str(cmd) | |
2248 | ec = os.system(cmd) |
|
2248 | ec = os.system(cmd) | |
|
2249 | # The high byte is the exit code, the low byte is a signal number | |||
|
2250 | # that we discard for now. See the docs for os.wait() | |||
|
2251 | if ec > 255: | |||
|
2252 | ec >>= 8 | |||
2249 |
|
2253 | |||
2250 | # We explicitly do NOT return the subprocess status code, because |
|
2254 | # We explicitly do NOT return the subprocess status code, because | |
2251 | # a non-None value would trigger :func:`sys.displayhook` calls. |
|
2255 | # a non-None value would trigger :func:`sys.displayhook` calls. |
@@ -414,6 +414,11 b' class TestSystemRaw(unittest.TestCase):' | |||||
414 | """ |
|
414 | """ | |
415 | cmd = ur'''python -c "'åäö'" ''' |
|
415 | cmd = ur'''python -c "'åäö'" ''' | |
416 | ip.system_raw(cmd) |
|
416 | ip.system_raw(cmd) | |
|
417 | ||||
|
418 | def test_exit_code(self): | |||
|
419 | """Test that the exit code is parsed correctly.""" | |||
|
420 | ip.system_raw('exit 1') | |||
|
421 | self.assertEqual(ip.user_ns['_exit_code'], 1) | |||
417 |
|
422 | |||
418 | class TestModules(unittest.TestCase, tt.TempFileMixin): |
|
423 | class TestModules(unittest.TestCase, tt.TempFileMixin): | |
419 | def test_extraneous_loads(self): |
|
424 | def test_extraneous_loads(self): |
General Comments 0
You need to be logged in to leave comments.
Login now