diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-07-11 17:01:17 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-07-11 17:01:17 (GMT) |
commit | e3ed4edb94cadaef747f6032c52cd903a169883e (patch) | |
tree | 10c8894b3db87f6104d0148e60c1f83e51dcff27 /Lib/test/test_cmd_line.py | |
parent | e173d0123171adc1b5145ef7613364e14ccbd945 (diff) | |
download | cpython-e3ed4edb94cadaef747f6032c52cd903a169883e.zip cpython-e3ed4edb94cadaef747f6032c52cd903a169883e.tar.gz cpython-e3ed4edb94cadaef747f6032c52cd903a169883e.tar.bz2 |
Issue #18338: `python --version` now prints version string to stdout, and
not to stderr. Patch by Berker Peksag and Michael Dickens.
Diffstat (limited to 'Lib/test/test_cmd_line.py')
-rw-r--r-- | Lib/test/test_cmd_line.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index 1270ce3..3fa8ade 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py @@ -41,8 +41,10 @@ class CmdLineTest(unittest.TestCase): def test_version(self): version = ('Python %d.%d' % sys.version_info[:2]).encode("ascii") - rc, out, err = assert_python_ok('-V') - self.assertTrue(err.startswith(version)) + for switch in '-V', '--version': + rc, out, err = assert_python_ok(switch) + self.assertFalse(err.startswith(version)) + self.assertTrue(out.startswith(version)) def test_verbose(self): # -v causes imports to write to stderr. If the write to |