summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-02-10 11:37:21 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2017-02-10 11:37:21 (GMT)
commit2a35c939cc92b2f4ff41080497ce27e35dc5b858 (patch)
treea314fbcc88fd6ae9811da417b4a1bda1155e7097 /Lib/test
parent6f37e3645df5ef1820f3b9d21a0ebed7592d7edc (diff)
downloadcpython-2a35c939cc92b2f4ff41080497ce27e35dc5b858.zip
cpython-2a35c939cc92b2f4ff41080497ce27e35dc5b858.tar.gz
cpython-2a35c939cc92b2f4ff41080497ce27e35dc5b858.tar.bz2
Fix test_datetime on Windows
Issue #29100: On Windows, datetime.datetime.fromtimestamp(min_ts) fails with an OSError in test_timestamp_limits().
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/datetimetester.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py
index 42944a2..2350125 100644
--- 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:
- # 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