diff options
Diffstat (limited to 'Lib/test/test_popen.py')
-rw-r--r-- | Lib/test/test_popen.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_popen.py b/Lib/test/test_popen.py index da01a87..ab1bc77 100644 --- a/Lib/test/test_popen.py +++ b/Lib/test/test_popen.py @@ -44,10 +44,11 @@ class PopenTest(unittest.TestCase): def test_return_code(self): self.assertEqual(os.popen("exit 0").close(), None) + status = os.popen("exit 42").close() if os.name == 'nt': - self.assertEqual(os.popen("exit 42").close(), 42) + self.assertEqual(status, 42) else: - self.assertEqual(os.popen("exit 42").close(), 42 << 8) + self.assertEqual(os.waitstatus_to_exitcode(status), 42) def test_contextmanager(self): with os.popen("echo hello") as f: |