Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Lib/test/test_curses.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,13 @@ def get_pair_limit(self):
if (not curses.has_extended_color_support()
or (6, 1) <= curses.ncurses_version < (6, 2)):
pair_limit = min(pair_limit, SHORT_MAX)
# If use_default_colors() is called, the upper limit of the extended
# range may be restricted, so we need to check if the limit is still
# correct
try:
curses.init_pair(pair_limit, 0, 0)
except ValueError:
pair_limit = curses.COLOR_PAIRS
return pair_limit

@requires_colors
Expand Down