Skip to content

Commit

Permalink
Be robust to some argparse string variants
Browse files Browse the repository at this point in the history
  • Loading branch information
doegox committed Nov 6, 2023
1 parent ecf3c06 commit 4d670f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion software/script/chameleon_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 4d670f0

Please sign in to comment.