File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,8 +41,10 @@ def test_usage(self):
4141
4242 def test_version (self ):
4343 version = ('Python %d.%d' % sys .version_info [:2 ]).encode ("ascii" )
44- rc , out , err = assert_python_ok ('-V' )
45- self .assertTrue (err .startswith (version ))
44+ for switch in '-V' , '--version' :
45+ rc , out , err = assert_python_ok (switch )
46+ self .assertFalse (err .startswith (version ))
47+ self .assertTrue (out .startswith (version ))
4648
4749 def test_verbose (self ):
4850 # -v causes imports to write to stderr. If the write to
Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ What's New in Python 3.4.0 Alpha 1?
1010Core and Builtins
1111-----------------
1212
13+ - Issue #18338: `python --version` now prints version string to stdout, and
14+ not to stderr. Patch by Berker Peksag and Michael Dickens.
15+
1316- Issue #18426: Fix NULL pointer dereference in C extension import when
1417 PyModule_GetDef() returns an error.
1518
Original file line number Diff line number Diff line change @@ -500,7 +500,7 @@ Py_Main(int argc, wchar_t **argv)
500500 return usage (0 , argv [0 ]);
501501
502502 if (version ) {
503- fprintf ( stderr , "Python %s\n" , PY_VERSION );
503+ printf ( "Python %s\n" , PY_VERSION );
504504 return 0 ;
505505 }
506506
You can’t perform that action at this time.
0 commit comments