From db90cb85094a2cab19a524ad30b603e26cbb76fe Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Mon, 2 Jul 2018 03:25:58 +0200 Subject: Simplify some dict.get() calls by passing defaults --- kconfiglib.py | 7 ++----- 1 file 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 -- cgit v1.2.3