summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2019-10-05 22:19:21 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2019-10-05 22:57:55 +0200
commit72e3d20a14f0f82a5909da74a3d6a0c20aac185d (patch)
tree80647a40ad40fe7f92d2feed45ee6b1091bb9ef1
parent21b4c1e3b6e2867b9a0788d21a358f6b1f581d86 (diff)
menuconfig: Give hint when 'curses' can't be imported on Windows
Tell people to install something like windows-curses. Might help avoid some trouble after commit 21b4c1e ("Do not automatically install windows-curses on Windows").
-rwxr-xr-xmenuconfig.py24
1 files changed, 22 insertions, 2 deletions
diff --git a/menuconfig.py b/menuconfig.py
index 58175c3..552b537 100755
--- a/menuconfig.py
+++ b/menuconfig.py
@@ -182,12 +182,32 @@ See the https://github.com/zephyrproject-rtos/windows-curses repository.
"""
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, \