Skip to content

Commit

Permalink
fix editor for python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
SilenZcience committed Jan 22, 2024
1 parent b784e64 commit 0d9c099
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cat_win/util/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0d9c099

Please sign in to comment.