From 4d670f051a9a4adea43f431432538396a7bf4e8a Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Mon, 6 Nov 2023 22:45:48 +0100 Subject: [PATCH] Be robust to some argparse string variants --- software/script/chameleon_utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/software/script/chameleon_utils.py b/software/script/chameleon_utils.py index eef07ce9..f10c4a6e 100644 --- a/software/script/chameleon_utils.py +++ b/software/script/chameleon_utils.py @@ -88,8 +88,10 @@ def print_help(self): options = lines lines = [] if len(options) > 0: - assert options[0].strip() == 'options:' + # 2 variants depending on Python version(?) + assert options[0].strip() in ['options:', 'optional arguments:'] options[0] = options[0].replace('options:', f'{CG}options:{C0}') + options[0] = options[0].replace('optional arguments:', f'{CG}optional arguments:{C0}') if len(options) > 1: options.append('') print('\n'.join(options))