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:
Bénédikt Tran 2025-05-19 15:53:39 +02:00 committed by GitHub
parent c31547a591
commit ee36db5500
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 366 additions and 179 deletions

View file

@ -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))