changeset: 106490:1c6b87b07586 branch: 3.6 parent: 106488:383c0238b5b0 user: Victor Stinner date: Fri Feb 10 11:45:14 2017 +0100 files: Lib/test/datetimetester.py description: Fix test_datetime on system with 32-bit time_t Issue #29100: Catch OverflowError in the new test_timestamp_limits() test. diff -r 383c0238b5b0 -r 1c6b87b07586 Lib/test/datetimetester.py --- a/Lib/test/datetimetester.py Fri Feb 10 10:34:02 2017 +0100 +++ b/Lib/test/datetimetester.py Fri Feb 10 11:45:14 2017 +0100 @@ -1993,9 +1993,13 @@ # minimum timestamp min_dt = self.theclass.min.replace(tzinfo=timezone.utc) min_ts = min_dt.timestamp() - # date 0001-01-01 00:00:00+00:00: timestamp=-62135596800 - self.assertEqual(self.theclass.fromtimestamp(min_ts, tz=timezone.utc), - min_dt) + try: + # date 0001-01-01 00:00:00+00:00: timestamp=-62135596800 + self.assertEqual(self.theclass.fromtimestamp(min_ts, tz=timezone.utc), + min_dt) + except OverflowError as exc: + # the date 0001-01-01 doesn't fit into 32-bit time_t + self.skipTest(str(exc)) # maximum timestamp: set seconds to zero to avoid rounding issues max_dt = self.theclass.max.replace(tzinfo=timezone.utc,