Skip to content

bpo-34532: Fixed exit code for py.exe list versions arg #9039

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixes exit code of list version arguments for py.exe.
9 changes: 5 additions & 4 deletions PC/launcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down