Skip to content

Commit 129642a

Browse files
bpo-34532: Fixed exit code for py.exe list versions arg (GH-9039)
(cherry picked from commit c8fe9cc) Co-authored-by: Brendan Gerrity <[email protected]>
1 parent 6eff6b8 commit 129642a

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
@@ -1453,7 +1453,7 @@ show_python_list(wchar_t ** argv)
14531453
fwprintf(stderr, L"\n\nCan't find a Default Python.\n\n");
14541454
else
14551455
fwprintf(stderr, L"\n\n"); /* End with a blank line */
1456-
return(FALSE); /* If this has been called we cannot continue */
1456+
return FALSE; /* If this has been called we cannot continue */
14571457
}
14581458

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

0 commit comments

Comments
 (0)