Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b67f096 commit 6f37e36Copy full SHA for 6f37e36
Lib/test/datetimetester.py
@@ -1993,9 +1993,13 @@ def test_timestamp_limits(self):
1993
# minimum timestamp
1994
min_dt = self.theclass.min.replace(tzinfo=timezone.utc)
1995
min_ts = min_dt.timestamp()
1996
- # date 0001-01-01 00:00:00+00:00: timestamp=-62135596800
1997
- self.assertEqual(self.theclass.fromtimestamp(min_ts, tz=timezone.utc),
1998
- min_dt)
+ try:
+ # date 0001-01-01 00:00:00+00:00: timestamp=-62135596800
+ self.assertEqual(self.theclass.fromtimestamp(min_ts, tz=timezone.utc),
1999
+ min_dt)
2000
+ except OverflowError as exc:
2001
+ # the date 0001-01-01 doesn't fit into 32-bit time_t
2002
+ self.skipTest(str(exc))
2003
2004
# maximum timestamp: set seconds to zero to avoid rounding issues
2005
max_dt = self.theclass.max.replace(tzinfo=timezone.utc,
0 commit comments