diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2018-07-02 03:25:58 +0200 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2018-07-02 03:25:58 +0200 |
| commit | db90cb85094a2cab19a524ad30b603e26cbb76fe (patch) | |
| tree | 6a892b4d31a62b19dd7757478578eb3c4553a4cc | |
| parent | b487258624b26eef061938827a9e1e700ce04858 (diff) | |
Simplify some dict.get() calls by passing defaults
| -rw-r--r-- | kconfiglib.py | 7 |
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 |
