diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py index 2f4eda96c05216..1cf2dfc776331b 100644 --- a/Lib/test/test_time.py +++ b/Lib/test/test_time.py @@ -1077,6 +1077,11 @@ def check_ratio_rounding(self, pytime_converter, expected_func, units = int(decimal.Decimal(ps).scaleb(exp).quantize(1)) if value_filter and not value_filter(units // sec_to_unit): continue + if (value_filter and _testinternalcapi.SIZEOF_TIME_T < 8 + and not value_filter(ps // 10**12)): + # A value slightly less than the time_t minimum + # overflows even if it is rounded up to it. + continue expected = expected_func(units) for value in (fractions.Fraction(ps, 10**12), decimal.Decimal(ps).scaleb(-12),