From acdd80de097e528a95c5918d88de692e5c5f9965 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Sat, 15 Dec 2012 07:23:14 +0100 Subject: Simplify _parse_error(). --- kconfiglib.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/kconfiglib.py b/kconfiglib.py index d55d020..bb40771 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -3727,12 +3727,8 @@ def _parse_error(s, msg, filename, linenr): if s.endswith("\n"): s = s[:-1] - error_str += 'Error while parsing "{0}"'.format(s) - - if msg is None: - error_str += "." - else: - error_str += ": " + msg + error_str += 'Error while parsing "{0}"'.format(s) + \ + ("." if msg is None else ": " + msg) raise Kconfig_Syntax_Error, error_str -- cgit v1.2.3