From f51d7ec0db6dc326c4d3b7cd0696cfb467319cc2 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Mon, 4 Sep 2017 12:47:29 +0300 Subject: [PATCH] time: time_t is at least long int, convert it as such. Rumors even says that it may be long long on recent 32-bit Linux x86 systems. --- time/time.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/time/time.py b/time/time.py index 6171bc9d..d811289c 100644 --- a/time/time.py +++ b/time/time.py @@ -40,7 +40,7 @@ def localtime(t=None): t = time() t = int(t) - a = ustruct.pack('i', t) + a = ustruct.pack('l', t) tm_p = localtime_(a) return _c_tm_to_tuple(uctypes.bytearray_at(tm_p, 36)) @@ -50,7 +50,7 @@ def gmtime(t=None): t = time() t = int(t) - a = ustruct.pack('i', t) + a = ustruct.pack('l', t) tm_p = gmtime_(a) return _c_tm_to_tuple(uctypes.bytearray_at(tm_p, 36))