summaryrefslogtreecommitdiff
path: root/allyesconfig.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 /allyesconfig.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 'allyesconfig.py')
-rwxr-xr-xallyesconfig.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/allyesconfig.py b/allyesconfig.py
index 45231bc..e19ab31 100755
--- a/allyesconfig.py
+++ b/allyesconfig.py
@@ -20,7 +20,7 @@ def main():
kconf = kconfiglib.standard_kconfig()
# See allnoconfig.py
- kconf.disable_warnings()
+ kconf.warn = False
# Try to set all symbols to 'y'. Dependencies might truncate the value down
# later, but this will at least give the highest possible value.
@@ -45,7 +45,7 @@ def main():
for choice in kconf.unique_choices:
choice.set_value(2)
- kconf.enable_warnings()
+ kconf.warn = True
kconfiglib.load_allconfig(kconf, "allyes.config")