mirror of https://github.com/python/cpython
bpo-39802: Only expose set_escdelay and set_tabsize when curses extensions are activated (GH-18705)
This commit is contained in:
parent
6daa37fd42
commit
4991cf47c4
|
@ -3255,6 +3255,9 @@ _curses_setupterm_impl(PyObject *module, const char *term, int fd)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
#if defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20081102
|
||||
// https://invisible-island.net/ncurses/NEWS.html#index-t20080119
|
||||
|
||||
/*[clinic input]
|
||||
_curses.get_escdelay
|
||||
|
||||
|
@ -3334,6 +3337,7 @@ _curses_set_tabsize_impl(PyObject *module, int size)
|
|||
|
||||
return PyCursesCheckERR(set_tabsize(size), "set_tabsize");
|
||||
}
|
||||
#endif
|
||||
|
||||
/*[clinic input]
|
||||
_curses.intrflush
|
||||
|
@ -4508,8 +4512,10 @@ static PyMethodDef PyCurses_methods[] = {
|
|||
_CURSES_RESIZETERM_METHODDEF
|
||||
_CURSES_RESIZE_TERM_METHODDEF
|
||||
_CURSES_SAVETTY_METHODDEF
|
||||
#if defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20081102
|
||||
_CURSES_GET_ESCDELAY_METHODDEF
|
||||
_CURSES_SET_ESCDELAY_METHODDEF
|
||||
#endif
|
||||
_CURSES_GET_TABSIZE_METHODDEF
|
||||
_CURSES_SET_TABSIZE_METHODDEF
|
||||
_CURSES_SETSYX_METHODDEF
|
||||
|
|
|
@ -3040,6 +3040,8 @@ exit:
|
|||
return return_value;
|
||||
}
|
||||
|
||||
#if (defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20081102)
|
||||
|
||||
PyDoc_STRVAR(_curses_get_escdelay__doc__,
|
||||
"get_escdelay($module, /)\n"
|
||||
"--\n"
|
||||
|
@ -3062,6 +3064,10 @@ _curses_get_escdelay(PyObject *module, PyObject *Py_UNUSED(ignored))
|
|||
return _curses_get_escdelay_impl(module);
|
||||
}
|
||||
|
||||
#endif /* (defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20081102) */
|
||||
|
||||
#if (defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20081102)
|
||||
|
||||
PyDoc_STRVAR(_curses_set_escdelay__doc__,
|
||||
"set_escdelay($module, ms, /)\n"
|
||||
"--\n"
|
||||
|
@ -3102,6 +3108,10 @@ exit:
|
|||
return return_value;
|
||||
}
|
||||
|
||||
#endif /* (defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20081102) */
|
||||
|
||||
#if (defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20081102)
|
||||
|
||||
PyDoc_STRVAR(_curses_get_tabsize__doc__,
|
||||
"get_tabsize($module, /)\n"
|
||||
"--\n"
|
||||
|
@ -3123,6 +3133,10 @@ _curses_get_tabsize(PyObject *module, PyObject *Py_UNUSED(ignored))
|
|||
return _curses_get_tabsize_impl(module);
|
||||
}
|
||||
|
||||
#endif /* (defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20081102) */
|
||||
|
||||
#if (defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20081102)
|
||||
|
||||
PyDoc_STRVAR(_curses_set_tabsize__doc__,
|
||||
"set_tabsize($module, size, /)\n"
|
||||
"--\n"
|
||||
|
@ -3162,6 +3176,8 @@ exit:
|
|||
return return_value;
|
||||
}
|
||||
|
||||
#endif /* (defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20081102) */
|
||||
|
||||
PyDoc_STRVAR(_curses_intrflush__doc__,
|
||||
"intrflush($module, flag, /)\n"
|
||||
"--\n"
|
||||
|
@ -4638,6 +4654,22 @@ _curses_use_default_colors(PyObject *module, PyObject *Py_UNUSED(ignored))
|
|||
#define _CURSES_HAS_KEY_METHODDEF
|
||||
#endif /* !defined(_CURSES_HAS_KEY_METHODDEF) */
|
||||
|
||||
#ifndef _CURSES_GET_ESCDELAY_METHODDEF
|
||||
#define _CURSES_GET_ESCDELAY_METHODDEF
|
||||
#endif /* !defined(_CURSES_GET_ESCDELAY_METHODDEF) */
|
||||
|
||||
#ifndef _CURSES_SET_ESCDELAY_METHODDEF
|
||||
#define _CURSES_SET_ESCDELAY_METHODDEF
|
||||
#endif /* !defined(_CURSES_SET_ESCDELAY_METHODDEF) */
|
||||
|
||||
#ifndef _CURSES_GET_TABSIZE_METHODDEF
|
||||
#define _CURSES_GET_TABSIZE_METHODDEF
|
||||
#endif /* !defined(_CURSES_GET_TABSIZE_METHODDEF) */
|
||||
|
||||
#ifndef _CURSES_SET_TABSIZE_METHODDEF
|
||||
#define _CURSES_SET_TABSIZE_METHODDEF
|
||||
#endif /* !defined(_CURSES_SET_TABSIZE_METHODDEF) */
|
||||
|
||||
#ifndef _CURSES_IS_TERM_RESIZED_METHODDEF
|
||||
#define _CURSES_IS_TERM_RESIZED_METHODDEF
|
||||
#endif /* !defined(_CURSES_IS_TERM_RESIZED_METHODDEF) */
|
||||
|
@ -4681,4 +4713,4 @@ _curses_use_default_colors(PyObject *module, PyObject *Py_UNUSED(ignored))
|
|||
#ifndef _CURSES_USE_DEFAULT_COLORS_METHODDEF
|
||||
#define _CURSES_USE_DEFAULT_COLORS_METHODDEF
|
||||
#endif /* !defined(_CURSES_USE_DEFAULT_COLORS_METHODDEF) */
|
||||
/*[clinic end generated code: output=0ca4f95323c5d585 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=b53652f8acafd817 input=a9049054013a1b77]*/
|
||||
|
|
Loading…
Reference in New Issue