diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/epy_reader/__init__.py | 2 | ||||
-rw-r--r-- | src/epy_reader/board.py | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/epy_reader/__init__.py b/src/epy_reader/__init__.py index 3a08311..422e701 100644 --- a/src/epy_reader/__init__.py +++ b/src/epy_reader/__init__.py @@ -1,4 +1,4 @@ -__version__ = "2022.12.11" +__version__ = "2023.02.08" __license__ = "GPL-3.0" __author__ = "Benawi Adha" __email__ = "benawiadha@gmail.com" diff --git a/src/epy_reader/board.py b/src/epy_reader/board.py index 0562d3f..9c5423e 100644 --- a/src/epy_reader/board.py +++ b/src/epy_reader/board.py @@ -79,7 +79,19 @@ class InfiniBoard: def write(self, row: int, bottom_padding: int = 0) -> None: for n_row in range(min(self.screen_rows - bottom_padding, self.total_lines - row)): text_line = self.text[row + n_row] - self.screen.addstr(n_row, self.x, text_line) + + # NOTE: A bug with python itself: https://bugs.python.org/issue8243 + # It's stated in python docs: + # > Attempting to write to the lower right corner of a window, subwindow, + # > or pad will cause an exception to be raised after the character is printed. + # https://github.com/python/cpython/commit/ef5ce884a41c8553a7eff66ebace908c1dcc1f89#diff-cb5622768373b8c93cc8eee30dfb041108783bb419d9eaf205501989cea0049fR691-R692 + # + # Since the exception is raised "after the character is printed" + # then it seems to be safe to catch it. + try: + self.screen.addstr(n_row, self.x, text_line) + except curses.error: + pass if ( self.spread == 2 |