summaryrefslogtreecommitdiff
path: root/menuconfig.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2019-06-03 01:55:50 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2019-06-03 06:50:06 +0200
commitbf36f5de0f49d56975b1a844e25484ec385dc971 (patch)
tree258589b5bbf8a64ced24c27bded8f4e08805106c /menuconfig.py
parent55bc8c380869ea663092212e8fe388ad7abae596 (diff)
Improve warning control API (with backwards compatibility)
A wart of the warning control API (enable/disable_*_warnings()) is that the current warning settings can't be queried. Querying warning settings is useful in functions that want to temporarily enable/disable some warning and then put things back to how they were. kconfiglib.load_allconfig() ran into this, for example. Make the internal warning control variables public (improve the naming at the same time), and encourage just setting them directly. Keep the old API for backwards compatibility. Also remove _warn_redun_assign() and _warn_override(). They're trivial and were called in a single place.
Diffstat (limited to 'menuconfig.py')
-rwxr-xr-xmenuconfig.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/menuconfig.py b/menuconfig.py
index a7f921b..a5345b2 100755
--- a/menuconfig.py
+++ b/menuconfig.py
@@ -673,7 +673,7 @@ def menuconfig(kconf):
# Disable warnings. They get mangled in curses mode, and we deal with
# errors ourselves.
- kconf.disable_warnings()
+ kconf.warn = False
# Make curses use the locale settings specified in the environment
locale.setlocale(locale.LC_ALL, "")
@@ -923,6 +923,7 @@ def _quit_dialog():
return None
if c == "y":
+ # Returns a message to print
msg = _try_save(_kconf.write_config, _conf_filename, "configuration")
if msg:
return msg