From d1eedf6f4e1a8b0a460ed7b3bc2ef7adcbe3a232 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Fri, 12 Jun 2015 04:21:01 +0200 Subject: Simplify Symbol._make_conf(). --- kconfiglib.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/kconfiglib.py b/kconfiglib.py index dcda3e7..fe91a2c 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -2520,18 +2520,17 @@ class Symbol(Item): return ["CONFIG_{0}={1}".format(self.name, val)] return ["# CONFIG_{0} is not set".format(self.name)] - elif self.type == INT or self.type == HEX: + if self.type == INT or self.type == HEX: return ["CONFIG_{0}={1}".format(self.name, val)] - elif self.type == STRING: + if self.type == STRING: # Escape \ and " return ['CONFIG_{0}="{1}"' .format(self.name, val.replace("\\", "\\\\").replace('"', '\\"'))] - else: - _internal_error("Internal error while creating .config: unknown " - 'type "{0}".'.format(self.type)) + _internal_error("Internal error while creating .config: unknown " + 'type "{0}".'.format(self.type)) def _get_dependent(self): """Returns the set of symbols that should be invalidated if the value -- cgit v1.2.3