From 9dd957c9d3979875bdffca0955be33b9ebde64dc Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Thu, 18 Jan 2024 12:22:08 +0100 Subject: [PATCH] jwutils.Options: Increase option parsing error verbosity Signed-off-by: Jan Lindemann --- tools/python/jwutils/Options.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/python/jwutils/Options.py b/tools/python/jwutils/Options.py index 1b19d66..78ce356 100644 --- a/tools/python/jwutils/Options.py +++ b/tools/python/jwutils/Options.py @@ -3,6 +3,7 @@ import json from collections import OrderedDict from .log import * import shlex +import traceback class Options: # export @@ -39,7 +40,12 @@ class Options: # export if r is not None: return r r = cls() - opt_strs = shlex.split(opts_str) + try: + opt_strs = shlex.split(opts_str) + except Exception as e: + slog_m(ERR, traceback.format_exc()) + slog(ERR, 'Failed to split options string >{}<'.format(opts_str)) + raise for opt_str in opt_strs: opt_str = re.sub('\s*=\s*', '=', opt_str) sides = opt_str.split('=')