diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-02-10 11:45:28 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2017-02-10 11:45:28 +0100 |
commit | 5df8c78027274de63ba88da99daf4ed48f041171 (patch) | |
tree | af76102f8763e3db50d388d29f271d87830e0f0f /Lib/test | |
parent | 0b87bc9a510db8933ec52eee2cbe71b2388ad5c3 (diff) | |
parent | e7274193ca5c816cf4c012b2151632bc447f0d0c (diff) | |
download | cpython-5df8c78027274de63ba88da99daf4ed48f041171.tar.gz |
Merge 3.6
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/datetimetester.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py index 7feabced94..42944a2d06 100644 --- a/Lib/test/datetimetester.py +++ b/Lib/test/datetimetester.py @@ -1993,9 +1993,13 @@ class TestDateTime(TestDate): # 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, |