changeset: 106492:1555e7776321 branch: 3.6 parent: 106490:1c6b87b07586 user: Victor Stinner date: Fri Feb 10 12:37:21 2017 +0100 files: Lib/test/datetimetester.py description: Fix test_datetime on Windows Issue #29100: On Windows, datetime.datetime.fromtimestamp(min_ts) fails with an OSError in test_timestamp_limits(). diff -r 1c6b87b07586 -r 1555e7776321 Lib/test/datetimetester.py --- a/Lib/test/datetimetester.py Fri Feb 10 11:45:14 2017 +0100 +++ b/Lib/test/datetimetester.py Fri Feb 10 12:37:21 2017 +0100 @@ -1997,8 +1997,9 @@ # 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 + except (OverflowError, OSError) as exc: + # the date 0001-01-01 doesn't fit into 32-bit time_t, + # or platform doesn't support such very old date self.skipTest(str(exc)) # maximum timestamp: set seconds to zero to avoid rounding issues