diff options
author | Brendan Gerrity <brerrity@gmail.com> | 2018-11-20 21:28:27 (GMT) |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2018-11-20 21:28:27 (GMT) |
commit | c8fe9ccf7bfbcf9a2cb48e3b6abacf6ec0e5e58d (patch) | |
tree | 2cb6cd40c5745529d6f2db1ec1297f82733a0468 /PC | |
parent | b1dede3ee3498100b95265f7fdb0ea2bef9a2ba2 (diff) | |
download | cpython-c8fe9ccf7bfbcf9a2cb48e3b6abacf6ec0e5e58d.zip cpython-c8fe9ccf7bfbcf9a2cb48e3b6abacf6ec0e5e58d.tar.gz cpython-c8fe9ccf7bfbcf9a2cb48e3b6abacf6ec0e5e58d.tar.bz2 |
bpo-34532: Fixed exit code for py.exe list versions arg (GH-9039)
Diffstat (limited to 'PC')
-rw-r--r-- | PC/launcher.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/PC/launcher.c b/PC/launcher.c index 75a06c2..2c2da76 100644 --- a/PC/launcher.c +++ b/PC/launcher.c @@ -1454,7 +1454,7 @@ show_python_list(wchar_t ** argv) fwprintf(stderr, L"\n\nCan't find a Default Python.\n\n"); else fwprintf(stderr, L"\n\n"); /* End with a blank line */ - return(FALSE); /* If this has been called we cannot continue */ + return FALSE; /* If this has been called we cannot continue */ } static int @@ -1601,11 +1601,12 @@ process(int argc, wchar_t ** argv) else { p = argv[1]; plen = wcslen(p); - if ((argc == 2) && - (!wcsncmp(p, L"-0", wcslen(L"-0")) || /* Starts with -0 or --list */ + if ((argc == 2) && // list version args + (!wcsncmp(p, L"-0", wcslen(L"-0")) || !wcsncmp(p, L"--list", wcslen(L"--list")))) { - valid = show_python_list(argv); /* Check for -0 or --list FIRST */ + show_python_list(argv); + return rc; } valid = valid && (*p == L'-') && validate_version(&p[1]); if (valid) { |