cpython: 1555e7776321 (original) (raw)
Mercurial > cpython
changeset 106492:1555e7776321 3.6
Fix test_datetime on Windows Issue #29100: On Windows, datetime.datetime.fromtimestamp(min_ts) fails with an OSError in test_timestamp_limits(). [#29100]
Victor Stinner victor.stinner@gmail.com | |
---|---|
date | Fri, 10 Feb 2017 12:37:21 +0100 |
parents | 1c6b87b07586 |
children | 6bd09ab4d6d6 |
files | Lib/test/datetimetester.py |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-)[+] [-] Lib/test/datetimetester.py 5 |
line wrap: on
line diff
--- a/Lib/test/datetimetester.py +++ b/Lib/test/datetimetester.py @@ -1997,8 +1997,9 @@ class TestDateTime(TestDate): # 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:[](#l1.7)
# the date 0001-01-01 doesn't fit into 32-bit time_t[](#l1.8)
except (OverflowError, OSError) as exc:[](#l1.9)
# the date 0001-01-01 doesn't fit into 32-bit time_t,[](#l1.10)
# or platform doesn't support such very old date[](#l1.11) self.skipTest(str(exc))[](#l1.12)
# maximum timestamp: set seconds to zero to avoid rounding issues