Skip to content

Commit 1beaf12

Browse files
committed
Use a color pair that fits in a chtype in test_complexchar
A narrow build stores the pair in the A_COLOR bits, so complexchar() rejects 300 with OverflowError. Pair 1 still catches the pair leaking into attr.
1 parent 309d618 commit 1beaf12

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

Lib/test/test_curses.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -537,14 +537,11 @@ def test_complexchar(self):
537537
self.assertEqual(str(cc), 'z')
538538
self.assertEqual(cc.attr, 0)
539539
self.assertEqual(cc.pair, 0)
540-
# attr never carries the color pair, not even a pair that does not fit
541-
# in a color_pair() value.
540+
# attr never carries the color pair.
542541
self.assertEqual(curses.complexchar('A', 0, 1).attr, 0)
543-
self.assertEqual(curses.complexchar('A', 0, 300).attr, 0)
544542
self.assertEqual(curses.complexchar('A', curses.A_BOLD, 1).attr,
545543
curses.A_BOLD)
546544
self.assertEqual(curses.complexchar('A', 0, 1).pair, 1)
547-
self.assertEqual(curses.complexchar('A', 0, 300).pair, 300)
548545
# Immutable rendition.
549546
self.assertRaises(AttributeError, setattr, cc, 'attr', 1)
550547
self.assertRaises(AttributeError, setattr, cc, 'pair', 1)

0 commit comments

Comments
 (0)