diff --git a/cat_win/util/editor.py b/cat_win/util/editor.py index de81f5da..b4146a08 100644 --- a/cat_win/util/editor.py +++ b/cat_win/util/editor.py @@ -4,6 +4,17 @@ try: import curses + def initscr(): + # fix windows-curses for Python 3.12: + # https://github.com/zephyrproject-rtos/windows-curses/issues/50 + import _curses + stdscr = _curses.initscr() + for key, value in _curses.__dict__.items(): + if key[0:4] == 'ACS_' or key in ('LINES', 'COLS'): + setattr(curses, key, value) + + return stdscr + curses.initscr = initscr CURSES_MODULE_ERROR = False except ImportError: CURSES_MODULE_ERROR = True