Skip to content

Commit a8c6de2

Browse files
gh-67795: Skip test values below the time_t minimum on platforms with 32-bit time_t (GH-162878)
1 parent 846acf1 commit a8c6de2

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎Lib/test/test_time.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,6 +1077,11 @@ def check_ratio_rounding(self, pytime_converter, expected_func,
10771077
units = int(decimal.Decimal(ps).scaleb(exp).quantize(1))
10781078
if value_filter and not value_filter(units // sec_to_unit):
10791079
continue
1080+
if (value_filter and _testinternalcapi.SIZEOF_TIME_T < 8
1081+
and not value_filter(ps // 10**12)):
1082+
# A value slightly less than the time_t minimum
1083+
# overflows even if it is rounded up to it.
1084+
continue
10801085
expected = expected_func(units)
10811086
for value in (fractions.Fraction(ps, 10**12),
10821087
decimal.Decimal(ps).scaleb(-12),

0 commit comments

Comments
 (0)