Skip to content

Commit a202e5c

Browse files
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 <noreply@anthropic.com>
1 parent d49e76b commit a202e5c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Lib/test/test_curses.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2799,9 +2799,11 @@ def test_complexchar(self):
27992799
# its single character. A narrow build just forms fewer cells.
28002800
cc = curses.complexchar
28012801
def storable(s):
2802+
# ValueError if s has combining marks on a narrow build.
2803+
# OverflowError if s is a multibyte character on a narrow build.
28022804
try:
28032805
cc(s)
2804-
except ValueError:
2806+
except (ValueError, OverflowError):
28052807
return False
28062808
return True
28072809

0 commit comments

Comments
 (0)