Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Lib/test/test_popen.py

    r2 r391  
    1515# We can then eval() the result of this, and see what each argv was.
    1616python = sys.executable
    17 if ' ' in python:
    18     python = '"' + python + '"'     # quote embedded space for cmdline
    1917
    2018class PopenTest(unittest.TestCase):
    2119    def _do_test_commandline(self, cmdline, expected):
    2220        cmd = '%s -c "import sys;print sys.argv" %s' % (python, cmdline)
    23         data = os.popen(cmd).read()
     21        data = os.popen(cmd).read() + '\n'
    2422        got = eval(data)[1:] # strip off argv[0]
    2523        self.assertEqual(got, expected)
     
    4139        test_support.reap_children()
    4240
     41    def test_return_code(self):
     42        self.assertEqual(os.popen("exit 0").close(), None)
     43        if os.name == 'nt':
     44            self.assertEqual(os.popen("exit 42").close(), 42)
     45        else:
     46            self.assertEqual(os.popen("exit 42").close(), 42 << 8)
     47
    4348def test_main():
    4449    test_support.run_unittest(PopenTest)
Note: See TracChangeset for help on using the changeset viewer.