From 2aabbc9b927862fa4b90bbe4ea78f3fbd350e482 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Thu, 6 Aug 2026 03:22:27 +0300 Subject: [PATCH 1/2] gh-149755: fix Modules/_decimal/tests/deccheck.py This script was broken by 511ca945203 and a07da09ad5b. --- Modules/_decimal/tests/deccheck.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Modules/_decimal/tests/deccheck.py b/Modules/_decimal/tests/deccheck.py index bf277dd6879ffe7..db9a6acf848c11a 100644 --- a/Modules/_decimal/tests/deccheck.py +++ b/Modules/_decimal/tests/deccheck.py @@ -53,6 +53,8 @@ from formathelper import rand_format, rand_locale from _pydecimal import _dec_from_triple +sys.set_int_max_str_digits(0) + C = import_fresh_module('decimal', fresh=['_decimal']) P = import_fresh_module('decimal', blocked=['_decimal']) EXIT_STATUS = 0 @@ -969,6 +971,8 @@ def test_unary(method, prec, exp_range, restricted_range, itr, stat): try: if not convert(t): continue + if t.funcname == '__hash__' and t.cop[0].is_nan(): + continue callfuncs(t) verify(t, stat) except VerifyError as err: From d55ec49075db73c9c0171960929ee150992a83d3 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Thu, 6 Aug 2026 06:47:49 +0300 Subject: [PATCH 2/2] address review: filter out only qNaN's --- Modules/_decimal/tests/deccheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/_decimal/tests/deccheck.py b/Modules/_decimal/tests/deccheck.py index db9a6acf848c11a..ac2c1ed2d5ab0a0 100644 --- a/Modules/_decimal/tests/deccheck.py +++ b/Modules/_decimal/tests/deccheck.py @@ -971,7 +971,7 @@ def test_unary(method, prec, exp_range, restricted_range, itr, stat): try: if not convert(t): continue - if t.funcname == '__hash__' and t.cop[0].is_nan(): + if t.funcname == '__hash__' and t.cop[0].is_qnan(): continue callfuncs(t) verify(t, stat)