summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2016-07-26 16:23:16 (GMT)
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2016-07-26 16:23:16 (GMT)
commit611adf246639711489bc63382743fdd6428b4fe3 (patch)
tree65ec45cc7771fe0eaf626f271d8bef56962294fe /Lib
parent8d4989687cc8f7e4add7fd3b09e131fa26e3f132 (diff)
downloadcpython-611adf246639711489bc63382743fdd6428b4fe3.zip
cpython-611adf246639711489bc63382743fdd6428b4fe3.tar.gz
cpython-611adf246639711489bc63382743fdd6428b4fe3.tar.bz2
Issue #24773: Fixed tests failures on systems with 32-bit time_t.
Several 32-bit systems have issues with transitions in the year 2037. This is a bug in the system C library since time_t does not overflow until 2038, but let's skip tests starting from 2037 to work around those bugs.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/datetimetester.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py
index 78f0a87..d17c996 100644
--- a/Lib/test/datetimetester.py
+++ b/Lib/test/datetimetester.py
@@ -15,6 +15,7 @@ import pickle
import random
import struct
import unittest
+import sysconfig
from array import array
@@ -4675,6 +4676,7 @@ class ZoneInfoTest(unittest.TestCase):
zonename = 'America/New_York'
def setUp(self):
+ self.sizeof_time_t = sysconfig.get_config_var('SIZEOF_TIME_T')
if sys.platform == "win32":
self.skipTest("Skipping zoneinfo tests on Windows")
try:
@@ -4750,6 +4752,9 @@ class ZoneInfoTest(unittest.TestCase):
if self.zonename == 'Europe/Tallinn' and udt.date() == date(1999, 10, 31):
print("Skip %s %s transition" % (self.zonename, udt))
continue
+ if self.sizeof_time_t == 4 and udt.year >= 2037:
+ print("Skip %s %s transition for 32-bit time_t" % (self.zonename, udt))
+ continue
s0 = (udt - datetime(1970, 1, 1)) // SEC
ss = shift // SEC # shift seconds
for x in [-40 * 3600, -20*3600, -1, 0,