From d1c63b6517240455db9c5c844b1886125304b9a7 Mon Sep 17 00:00:00 2001 From: viogq <55494528+viogq@users.noreply.github.com> Date: Wed, 18 Sep 2019 14:23:36 +0000 Subject: [PATCH] fix err: 1 arg missing corner case --- tools/readable_bash.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/readable_bash.py b/tools/readable_bash.py index 6c8a7647..4891a6ee 100644 --- a/tools/readable_bash.py +++ b/tools/readable_bash.py @@ -225,11 +225,13 @@ class EditConf(Grammar): conffile = self[1] options = [] eq = "=" - if self[3] and "-s" in self[3].string: eq = " " ## try except # else err - for opt in re.split("\s+", self[4].string): - k, v = opt.split("=", 1) + if self[3] and "-s" in self[3].string: eq = " " + try: + for opt in re.split("\s+", self[4].string): + k, v = opt.split("=", 1) # try except , else err: 1 arg missing v = re.sub(r"\n+", "", fixup_tokens(v)) # not sure why newlines are getting doubled options.append("%s%s%s" % (k, eq, v)) + except: pass return "
" + self[1].string + " (change settings)
" + "\n".join(cgi.escape(s) for s in options) + "
\n" class CaptureOutput(Grammar):