Skip to content

Commit 4991cf4

Browse files
authored
bpo-39802: Only expose set_escdelay and set_tabsize when curses extensions are activated (pythonGH-18705)
1 parent 6daa37f commit 4991cf4

2 files changed

Lines changed: 39 additions & 1 deletion

File tree

Modules/_cursesmodule.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3255,6 +3255,9 @@ _curses_setupterm_impl(PyObject *module, const char *term, int fd)
32553255
Py_RETURN_NONE;
32563256
}
32573257

3258+
#if defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20081102
3259+
// https://invisible-island.net/ncurses/NEWS.html#index-t20080119
3260+
32583261
/*[clinic input]
32593262
_curses.get_escdelay
32603263
@@ -3334,6 +3337,7 @@ _curses_set_tabsize_impl(PyObject *module, int size)
33343337

33353338
return PyCursesCheckERR(set_tabsize(size), "set_tabsize");
33363339
}
3340+
#endif
33373341

33383342
/*[clinic input]
33393343
_curses.intrflush
@@ -4508,8 +4512,10 @@ static PyMethodDef PyCurses_methods[] = {
45084512
_CURSES_RESIZETERM_METHODDEF
45094513
_CURSES_RESIZE_TERM_METHODDEF
45104514
_CURSES_SAVETTY_METHODDEF
4515+
#if defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20081102
45114516
_CURSES_GET_ESCDELAY_METHODDEF
45124517
_CURSES_SET_ESCDELAY_METHODDEF
4518+
#endif
45134519
_CURSES_GET_TABSIZE_METHODDEF
45144520
_CURSES_SET_TABSIZE_METHODDEF
45154521
_CURSES_SETSYX_METHODDEF

Modules/clinic/_cursesmodule.c.h

Lines changed: 33 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)