Skip to content

Commit c8fe9cc

Browse files
bgerrityzooba
authored andcommitted
bpo-34532: Fixed exit code for py.exe list versions arg (GH-9039)
1 parent b1dede3 commit c8fe9cc

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixes exit code of list version arguments for py.exe.

PC/launcher.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,7 +1454,7 @@ show_python_list(wchar_t ** argv)
14541454
fwprintf(stderr, L"\n\nCan't find a Default Python.\n\n");
14551455
else
14561456
fwprintf(stderr, L"\n\n"); /* End with a blank line */
1457-
return(FALSE); /* If this has been called we cannot continue */
1457+
return FALSE; /* If this has been called we cannot continue */
14581458
}
14591459

14601460
static int
@@ -1601,11 +1601,12 @@ process(int argc, wchar_t ** argv)
16011601
else {
16021602
p = argv[1];
16031603
plen = wcslen(p);
1604-
if ((argc == 2) &&
1605-
(!wcsncmp(p, L"-0", wcslen(L"-0")) || /* Starts with -0 or --list */
1604+
if ((argc == 2) && // list version args
1605+
(!wcsncmp(p, L"-0", wcslen(L"-0")) ||
16061606
!wcsncmp(p, L"--list", wcslen(L"--list"))))
16071607
{
1608-
valid = show_python_list(argv); /* Check for -0 or --list FIRST */
1608+
show_python_list(argv);
1609+
return rc;
16091610
}
16101611
valid = valid && (*p == L'-') && validate_version(&p[1]);
16111612
if (valid) {

0 commit comments

Comments
 (0)