diff options
author | INADA Naoki <songofacandy@gmail.com> | 2016-11-21 11:58:10 (GMT) |
---|---|---|
committer | INADA Naoki <songofacandy@gmail.com> | 2016-11-21 11:58:10 (GMT) |
commit | 7fc69f23735330e98dffaa29c68f61856c0c8b27 (patch) | |
tree | dd32c8074939e2ff58e50086a5b12289f89c25bb /Modules | |
parent | d4510a8b689169c5a22346a04b58bdb7ef050f88 (diff) | |
parent | 0e175a6e762676fca6bfd656912bb862e29fbdd5 (diff) | |
download | cpython-7fc69f23735330e98dffaa29c68f61856c0c8b27.zip cpython-7fc69f23735330e98dffaa29c68f61856c0c8b27.tar.gz cpython-7fc69f23735330e98dffaa29c68f61856c0c8b27.tar.bz2 |
Issue #28532: Show sys.version when -V option is supplied twice
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/main.c b/Modules/main.c index 6986d94..d75f64a 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -74,6 +74,7 @@ static const char usage_3[] = "\ -v : verbose (trace import statements); also PYTHONVERBOSE=x\n\ can be supplied multiple times to increase verbosity\n\ -V : print the Python version number and exit (also --version)\n\ + when given twice, print more information about the build\n\ -W arg : warning control; arg is action:message:category:module:lineno\n\ also PYTHONWARNINGS=arg\n\ -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) return usage(0, argv[0]); if (version) { - printf("Python %s\n", PY_VERSION); + printf("Python %s\n", version >= 2 ? Py_GetVersion() : PY_VERSION); return 0; } |