File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -180,7 +180,12 @@ Generic options
180180
181181 Print the Python version number and exit. Example output could be::
182182
183- Python 3.0
183+ Python 3.6.0b2+
184+
185+ When given twice, print more information about the build, like::
186+
187+ Python 3.6.0b2+ (3.6:84a3c5003510+, Oct 26 2016, 02:33:55)
188+ [GCC 6.2.0 20161005]
184189
185190
186191.. _using-on-misc-options :
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ def test_usage(self):
4343
4444 def test_version (self ):
4545 version = ('Python %d.%d' % sys .version_info [:2 ]).encode ("ascii" )
46- for switch in '-V' , '--version' :
46+ for switch in '-V' , '--version' , '-VV' :
4747 rc , out , err = assert_python_ok (switch )
4848 self .assertFalse (err .startswith (version ))
4949 self .assertTrue (out .startswith (version ))
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ What's New in Python 3.6.0 beta 4
1010Core and Builtins
1111-----------------
1212
13+ - Issue #28532: Show sys.version when -V option is supplied twice.
14+
1315- Issue #28746: Fix the set_inheritable() file descriptor method on platforms
1416 that do not have the ioctl FIOCLEX and FIONCLEX commands.
1517
Original file line number Diff line number Diff line change @@ -194,7 +194,8 @@ searching for a module. Also provides information on module cleanup
194194at exit.
195195.TP
196196.B \- V ", " \-\- version
197- Prints the Python version number of the executable and exits.
197+ Prints the Python version number of the executable and exits. When given
198+ twice, print more information about the build.
198199.TP
199200.BI " \- W " argument
200201Warning control. Python sometimes prints warning message to
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ static const char usage_3[] = "\
7474-v : verbose (trace import statements); also PYTHONVERBOSE=x\n\
7575 can be supplied multiple times to increase verbosity\n\
7676-V : print the Python version number and exit (also --version)\n\
77+ when given twice, print more information about the build\n\
7778-W arg : warning control; arg is action:message:category:module:lineno\n\
7879 also PYTHONWARNINGS=arg\n\
7980-x : skip first line of source, allowing use of non-Unix forms of #!cmd\n\
@@ -512,7 +513,7 @@ Py_Main(int argc, wchar_t **argv)
512513 return usage (0 , argv [0 ]);
513514
514515 if (version ) {
515- printf ("Python %s\n" , PY_VERSION );
516+ printf ("Python %s\n" , version >= 2 ? Py_GetVersion () : PY_VERSION );
516517 return 0 ;
517518 }
518519
You can’t perform that action at this time.
0 commit comments