Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-126313: Fix a crash in curse.napms due to incorrect error handling #126351

Merged
merged 3 commits into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix an issue in :func:`curses.napms` when :func:`curses.initscr` has not yet
been called. Patch by Bénédikt Tran.
7 changes: 5 additions & 2 deletions Modules/_cursesmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -3815,8 +3815,11 @@ static int
_curses_napms_impl(PyObject *module, int ms)
/*[clinic end generated code: output=5f292a6a724491bd input=c6d6e01f2f1df9f7]*/
{
PyCursesStatefulInitialised(module);

if (!_PyCursesStatefulCheckFunction(module,
picnixz marked this conversation as resolved.
Show resolved Hide resolved
curses_initscr_called,
"initscr")) {
return -1;
}
return napms(ms);
}

Expand Down
Loading