mirror of https://github.com/python/cpython
Fix _curses.tiget*() functions: deny None to avoid a crash.
Fix the following calls: _curses.tigetflag(None), _curses.tigetnum(None), _curses.tigetstr(None).
This commit is contained in:
parent
6cbf90fc0f
commit
53ff86ea5f
|
@ -2466,7 +2466,7 @@ PyCurses_tigetflag(PyObject *self, PyObject *args)
|
|||
|
||||
PyCursesSetupTermCalled;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "z", &capname))
|
||||
if (!PyArg_ParseTuple(args, "s", &capname))
|
||||
return NULL;
|
||||
|
||||
return PyInt_FromLong( (long) tigetflag( capname ) );
|
||||
|
@ -2479,7 +2479,7 @@ PyCurses_tigetnum(PyObject *self, PyObject *args)
|
|||
|
||||
PyCursesSetupTermCalled;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "z", &capname))
|
||||
if (!PyArg_ParseTuple(args, "s", &capname))
|
||||
return NULL;
|
||||
|
||||
return PyInt_FromLong( (long) tigetnum( capname ) );
|
||||
|
@ -2492,7 +2492,7 @@ PyCurses_tigetstr(PyObject *self, PyObject *args)
|
|||
|
||||
PyCursesSetupTermCalled;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "z", &capname))
|
||||
if (!PyArg_ParseTuple(args, "s", &capname))
|
||||
return NULL;
|
||||
|
||||
capname = tigetstr( capname );
|
||||
|
|
Loading…
Reference in New Issue