From: Serhiy Storchaka Date: Sat, 18 Jul 2026 16:33:03 +0000 (+0300) Subject: gh-153395: Fix test_complexchar on narrow curses builds (GH-154005) X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=a202e5ce1ce9e1266208887bad990dd5b92180d8;p=thirdparty%2FPython%2Fcpython.git gh-153395: Fix test_complexchar on narrow curses builds (GH-154005) On a narrow build, complexchar() of a multibyte character raises OverflowError, not ValueError. Co-authored-by: Claude Opus 4.8 --- diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py index 3ba79be789cf..915eae5ec233 100644 --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -2799,9 +2799,11 @@ class TestAscii(unittest.TestCase): # its single character. A narrow build just forms fewer cells. cc = curses.complexchar def storable(s): + # ValueError if s has combining marks on a narrow build. + # OverflowError if s is a multibyte character on a narrow build. try: cc(s) - except ValueError: + except (ValueError, OverflowError): return False return True