From 1a3d08d0caa3cb481301bf8af819b16b76f96f76 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Tue, 17 Jul 2018 00:53:51 +0200 Subject: Simplify defconfig_filename() returns --- kconfiglib.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/kconfiglib.py b/kconfiglib.py index 224be4d..dc688f4 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -793,16 +793,14 @@ class Kconfig(object): """ See the class documentation. """ - if not self.defconfig_list: - return None - - for filename, cond in self.defconfig_list.defaults: - if expr_value(cond): - try: - with self._open_config(filename.str_value) as f: - return f.name - except IOError: - continue + if self.defconfig_list: + for filename, cond in self.defconfig_list.defaults: + if expr_value(cond): + try: + with self._open_config(filename.str_value) as f: + return f.name + except IOError: + continue return None -- cgit v1.2.3