Skip to content

Commit 34583e0

Browse files
committed
address review
- use `curses_set_error_*` prefix for error helpers - remove some macros with predefined messages - cleanly report both NULL and ERR cases
1 parent 5addb78 commit 34583e0

File tree

2 files changed

+188
-155
lines changed

2 files changed

+188
-155
lines changed

Include/py_curses.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@ static void **PyCurses_API;
108108
static const char catchall_ERR[] = "curses function returned ERR";
109109
static const char catchall_NULL[] = "curses function returned NULL";
110110

111+
#if defined(CURSES_MODULE) || defined(CURSES_PANEL_MODULE)
112+
/* Error messages shared by the curses package */
113+
# define CURSES_ERROR_FORMAT "%s() returned %s"
114+
# define CURSES_ERROR_VERBOSE_FORMAT "%s() (called by %s()) returned %s"
115+
# define CURSES_ERROR_MUST_CALL_FORMAT "must call %s() first"
116+
#endif
117+
111118
#ifdef __cplusplus
112119
}
113120
#endif

0 commit comments

Comments
 (0)