##// END OF EJS Templates
Merge pull request #2799 from takluyver/exit-code...
Min RK -
r9150:7e890993 merge
parent child Browse files
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.
@@ -415,6 +415,11 b' class TestSystemRaw(unittest.TestCase):'
415 cmd = ur'''python -c "'åäö'" '''
415 cmd = ur'''python -c "'åäö'" '''
416 ip.system_raw(cmd)
416 ip.system_raw(cmd)
417
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)
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):
420 """Test we're not loading modules on startup that we shouldn't.
425 """Test we're not loading modules on startup that we shouldn't.
General Comments 0
You need to be logged in to leave comments. Login now