mirror of https://github.com/python/cpython
[3.13] gh-126313: Fix a crash in curses.napms() due to incorrect error handling (GH-126351) (#126493)
gh-126313: Fix a crash in curses.napms() due to incorrect error handling (GH-126351)
This commit is contained in:
parent
6a084b9d60
commit
6e9da38866
|
@ -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.
|
|
@ -3688,7 +3688,10 @@ static int
|
||||||
_curses_napms_impl(PyObject *module, int ms)
|
_curses_napms_impl(PyObject *module, int ms)
|
||||||
/*[clinic end generated code: output=5f292a6a724491bd input=c6d6e01f2f1df9f7]*/
|
/*[clinic end generated code: output=5f292a6a724491bd input=c6d6e01f2f1df9f7]*/
|
||||||
{
|
{
|
||||||
PyCursesInitialised;
|
if (initialised != TRUE) {
|
||||||
|
PyErr_SetString(PyCursesError, "must call initscr() first");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
return napms(ms);
|
return napms(ms);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue