bpo-39502: Fix 64-bit Python PyTime_localtime() on AIX (GH-18285)

Fix time.localtime() on 64-bit AIX to support years before 1902 and after 2038.
This commit is contained in:
Michael Felt 2020-02-07 18:56:16 +01:00 committed by GitHub
parent b10dc3e7a1
commit de6f38db48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -0,0 +1,2 @@
Fix :func:`time.localtime` on 64-bit AIX to support years before 1902 and after 2038.
Patch by M Felt.

View File

@ -1059,7 +1059,7 @@ _PyTime_localtime(time_t t, struct tm *tm)
return 0;
#else /* !MS_WINDOWS */
#ifdef _AIX
#if defined(_AIX) && (SIZEOF_TIME_T < 8)
/* bpo-34373: AIX does not return NULL if t is too small or too large */
if (t < -2145916800 /* 1902-01-01 */
|| t > 2145916800 /* 2038-01-01 */) {