Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Include/py_curses.h
Original file line numberDiff line numberDiff line change
Expand Up@@ -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
Expand Down
3 changes: 3 additions & 0 deletions Lib/test/test_curses.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -130,6 +130,9 @@ def test_use_env(self):
curses.use_env(False)
curses.use_env(True)

def test_error(self):
self.assertIsSubclass(curses.error, Exception)

def test_create_windows(self):
win = curses.newwin(5, 10)
self.assertEqual(win.getbegyx(), (0, 0))
Expand Down
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
If possible, indicate which :mod:`curses` C function or macro is responsible
for raising a :exc:`curses.error` exception. Patch by Bénédikt Tran.
Loading