Skip to content

Commit f51d7ec

Browse files
committed
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.
1 parent c18ef60 commit f51d7ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

time/time.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def localtime(t=None):
4040
t = time()
4141

4242
t = int(t)
43-
a = ustruct.pack('i', t)
43+
a = ustruct.pack('l', t)
4444
tm_p = localtime_(a)
4545
return _c_tm_to_tuple(uctypes.bytearray_at(tm_p, 36))
4646

@@ -50,7 +50,7 @@ def gmtime(t=None):
5050
t = time()
5151

5252
t = int(t)
53-
a = ustruct.pack('i', t)
53+
a = ustruct.pack('l', t)
5454
tm_p = gmtime_(a)
5555
return _c_tm_to_tuple(uctypes.bytearray_at(tm_p, 36))
5656

0 commit comments

Comments
 (0)