Skip to content

Commit de6f38d

Browse files
authored
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.
1 parent b10dc3e commit de6f38d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix :func:`time.localtime` on 64-bit AIX to support years before 1902 and after 2038.
2+
Patch by M Felt.

Python/pytime.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@ _PyTime_localtime(time_t t, struct tm *tm)
10591059
return 0;
10601060
#else /* !MS_WINDOWS */
10611061

1062-
#ifdef _AIX
1062+
#if defined(_AIX) && (SIZEOF_TIME_T < 8)
10631063
/* bpo-34373: AIX does not return NULL if t is too small or too large */
10641064
if (t < -2145916800 /* 1902-01-01 */
10651065
|| t > 2145916800 /* 2038-01-01 */) {

0 commit comments

Comments
 (0)