We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a2f0654 commit ab2d481Copy full SHA for ab2d481
Lib/test/test_curses.py
@@ -926,6 +926,13 @@ def get_pair_limit(self):
926
if (not curses.has_extended_color_support()
927
or (6, 1) <= curses.ncurses_version < (6, 2)):
928
pair_limit = min(pair_limit, SHORT_MAX)
929
+ # If use_default_colors() is called, the upper limit of the extended
930
+ # range may be restricted, so we need to check if the limit is still
931
+ # correct
932
+ try:
933
+ curses.init_pair(pair_limit, 0, 0)
934
+ except ValueError:
935
+ pair_limit = curses.COLOR_PAIRS
936
return pair_limit
937
938
@requires_colors
0 commit comments