From 0d9c0998532161680ff248a45cec50cd5f75dd9d Mon Sep 17 00:00:00 2001 From: Silas Kraume Date: Mon, 22 Jan 2024 18:04:01 +0100 Subject: [PATCH] fix editor for python 3.12 --- cat_win/util/editor.py | 11 +++++++++++ 1 file changed, 11 insertions(+) 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