mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-125843: indicate which C function caused a curses.error
(#125844)
- Rename error helpers with a `curses_set_error_*` prefix instead of `PyCurses*`. - Cleanly report both NULL and ERR cases. - Raise `curses.error` in `is_linetouched` instead of a `TypeError`.
This commit is contained in:
parent
c31547a591
commit
ee36db5500
4 changed files with 366 additions and 179 deletions
|
@ -109,6 +109,13 @@ static void **PyCurses_API;
|
|||
static const char catchall_ERR[] = "curses function returned ERR";
|
||||
static const char catchall_NULL[] = "curses function returned NULL";
|
||||
|
||||
#if defined(CURSES_MODULE) || defined(CURSES_PANEL_MODULE)
|
||||
/* Error messages shared by the curses package */
|
||||
# define CURSES_ERROR_FORMAT "%s() returned %s"
|
||||
# define CURSES_ERROR_VERBOSE_FORMAT "%s() (called by %s()) returned %s"
|
||||
# define CURSES_ERROR_MUST_CALL_FORMAT "must call %s() first"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue