mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Fix test_datetime on Windows
Issue #29100: On Windows, datetime.datetime.fromtimestamp(min_ts) fails with an OSError in test_timestamp_limits().
This commit is contained in:
parent
6f37e3645d
commit
2a35c939cc
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue