mirror of
https://github.com/python/cpython
synced 2024-09-05 08:17:45 +00:00
bpo-38506: Fix the Windows py.exe launcher's misordering of 3.10 (GH-18307)
This commit is contained in:
parent
c26d5916d6
commit
f62dad16b8
|
@ -0,0 +1,2 @@
|
||||||
|
The Windows launcher now properly handles Python 3.10 when listing installed
|
||||||
|
Python versions.
|
|
@ -425,11 +425,21 @@ compare_pythons(const void * p1, const void * p2)
|
||||||
INSTALLED_PYTHON * ip1 = (INSTALLED_PYTHON *) p1;
|
INSTALLED_PYTHON * ip1 = (INSTALLED_PYTHON *) p1;
|
||||||
INSTALLED_PYTHON * ip2 = (INSTALLED_PYTHON *) p2;
|
INSTALLED_PYTHON * ip2 = (INSTALLED_PYTHON *) p2;
|
||||||
/* note reverse sorting on version */
|
/* note reverse sorting on version */
|
||||||
int result = wcscmp(ip2->version, ip1->version);
|
int result = CompareStringW(LOCALE_INVARIANT, SORT_DIGITSASNUMBERS,
|
||||||
|
ip2->version, -1, ip1->version, -1);
|
||||||
if (result == 0)
|
switch (result) {
|
||||||
result = ip2->bits - ip1->bits; /* 64 before 32 */
|
case 0:
|
||||||
return result;
|
error(0, L"CompareStringW failed");
|
||||||
|
return 0;
|
||||||
|
case CSTR_LESS_THAN:
|
||||||
|
return -1;
|
||||||
|
case CSTR_EQUAL:
|
||||||
|
return ip2->bits - ip1->bits; /* 64 before 32 */
|
||||||
|
case CSTR_GREATER_THAN:
|
||||||
|
return 1;
|
||||||
|
default:
|
||||||
|
return 0; // This should never be reached.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue