summaryrefslogtreecommitdiff
path: root/kconfiglib.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-07-02 03:25:58 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2018-07-02 03:25:58 +0200
commitdb90cb85094a2cab19a524ad30b603e26cbb76fe (patch)
tree6a892b4d31a62b19dd7757478578eb3c4553a4cc /kconfiglib.py
parentb487258624b26eef061938827a9e1e700ce04858 (diff)
Simplify some dict.get() calls by passing defaults
Diffstat (limited to 'kconfiglib.py')
-rw-r--r--kconfiglib.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index 3f96151..def3341 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -610,9 +610,7 @@ class Kconfig(object):
"""
self.srctree = os.environ.get("srctree")
- self.config_prefix = os.environ.get("CONFIG_")
- if self.config_prefix is None:
- self.config_prefix = "CONFIG_"
+ self.config_prefix = os.environ.get("CONFIG_", "CONFIG_")
# Regular expressions for parsing .config files, with the match()
# method assigned directly as a small optimization (microscopic in this
@@ -4643,8 +4641,7 @@ def standard_config_filename():
Helper for tools. Returns the value of KCONFIG_CONFIG (which specifies the
.config file to load/save) if it is set, and ".config" otherwise.
"""
- config_filename = os.environ.get("KCONFIG_CONFIG")
- return config_filename if config_filename is not None else ".config"
+ return os.environ.get("KCONFIG_CONFIG", ".config")
#
# Internal functions