Skip to content

Commit

Permalink
menuconfig: Give hint when 'curses' can't be imported on Windows
Browse files Browse the repository at this point in the history
Tell people to install something like windows-curses. Might help avoid
some trouble after commit 21b4c1e ("Do not automatically install
windows-curses on Windows").
  • Loading branch information
ulfalizer committed Oct 5, 2019
1 parent 21b4c1e commit 72e3d20
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions menuconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,32 @@
"""
from __future__ import print_function

import curses
import sys

try:
import curses
except ImportError as e:
if sys.platform != "win32":
raise
sys.exit("""\
menuconfig failed to import the standard Python 'curses' library. Try
installing a package like windows-curses
(https://github.com/zephyrproject-rtos/windows-curses) by running this command
in cmd.exe:
pip install windows-curses
Starting with Kconfiglib 13.0.0, windows-curses is no longer automatically
installed when installing Kconfiglib via pip on Windows (because it breaks
installation on MSYS2).
Exception:
{}: {}""".format(type(e).__name__, e))

import errno
import locale
import os
import re
import sys
import textwrap

from kconfiglib import Symbol, Choice, MENU, COMMENT, MenuNode, \
Expand Down

0 comments on commit 72e3d20

Please sign in to comment.