mirror of
https://github.com/python/cpython
synced 2024-09-05 16:38:56 +00:00
bpo-34532: Fixed exit code for py.exe list versions arg (GH-9039)
This commit is contained in:
parent
b1dede3ee3
commit
c8fe9ccf7b
|
@ -0,0 +1 @@
|
||||||
|
Fixes exit code of list version arguments for py.exe.
|
|
@ -1454,7 +1454,7 @@ show_python_list(wchar_t ** argv)
|
||||||
fwprintf(stderr, L"\n\nCan't find a Default Python.\n\n");
|
fwprintf(stderr, L"\n\nCan't find a Default Python.\n\n");
|
||||||
else
|
else
|
||||||
fwprintf(stderr, L"\n\n"); /* End with a blank line */
|
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
|
static int
|
||||||
|
@ -1601,11 +1601,12 @@ process(int argc, wchar_t ** argv)
|
||||||
else {
|
else {
|
||||||
p = argv[1];
|
p = argv[1];
|
||||||
plen = wcslen(p);
|
plen = wcslen(p);
|
||||||
if ((argc == 2) &&
|
if ((argc == 2) && // list version args
|
||||||
(!wcsncmp(p, L"-0", wcslen(L"-0")) || /* Starts with -0 or --list */
|
(!wcsncmp(p, L"-0", wcslen(L"-0")) ||
|
||||||
!wcsncmp(p, L"--list", wcslen(L"--list"))))
|
!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]);
|
valid = valid && (*p == L'-') && validate_version(&p[1]);
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|
Loading…
Reference in a new issue