Skip to content

Commit

Permalink
per #1534, add additional strip commands to ensure that all whitespac…
Browse files Browse the repository at this point in the history
…e is removed properly, ci-run-all-diff
  • Loading branch information
georgemccabe committed Mar 23, 2022
1 parent e851de3 commit 53e7f09
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions metplus/util/string_manip.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ def getlist(list_str, expand_begin_end_incr=True):
return []

# remove surrounding comma and spaces from the string
list_str = list_str.strip(', ')
list_str = list_str.strip(', ').strip()

# remove trailing semi-colon IF found after []s
if list_str.endswith('];'):
list_str = list_str.strip('; ')
list_str = list_str.strip('; ').strip()

# remove [ from start (left) and ] from end (right)
list_str = list_str.lstrip('[ ').rstrip('] ')
list_str = list_str.lstrip('[ ').rstrip('] ').strip()

# remove space around commas
list_str = re.sub(r'\s*,\s*', ',', list_str)
Expand Down

0 comments on commit 53e7f09

Please sign in to comment.