Skip to content

gh-154788: Make curses window.getparent() unconditional - #154789

Open
fedonman wants to merge 1 commit into
python:mainfrom
fedonman:curses-getparent-unconditional
Open

gh-154788: Make curses window.getparent() unconditional#154789
fedonman wants to merge 1 commit into
python:mainfrom
fedonman:curses-getparent-unconditional

Conversation

@fedonman

@fedonman fedonman commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

window.getparent() calls no curses function: it returns the window's stored parent. It was
compiled only when the ncurses extension functions were present, so it was missing on
backends without them, although the documentation lists no availability requirement for it.
The guard now closes after getscrreg(), which does need it.

The test moves out of test_state_getters, which is gated on is_scrollok(), so that
getparent() is covered on backends without the extensions.

Compiling the extensions-absent configuration is not possible here, since the ncurses header
defines NCURSES_EXT_FUNCS, so that side rests on reading the code. getparent() is new in
3.16, so there is no NEWS entry.

getparent() calls no curses function, it returns the window's stored parent,
but it was compiled only when the ncurses extension functions were present.
Close the guard after getscrreg(), which does need it.

The test moves out of test_state_getters, which is gated on is_scrollok(), so
that getparent() is covered on backends without the extensions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant