Skip to content

Commit

Permalink
add strip() to get_bool()
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkonie committed Jul 18, 2024
1 parent 91b62f1 commit d5adaed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions samplesheets/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,8 @@ def get_bool(bool_string):
"""
if not isinstance(bool_string, str):
raise ValueError('Value is not a string')
if bool_string.lower() in ['1', 't', 'true', 'y', 'yes']:
if bool_string.strip().lower() in ['1', 't', 'true', 'y', 'yes']:
return True
if bool_string.lower() in ['0', 'f', 'false', 'n', 'no']:
if bool_string.strip().lower() in ['0', 'f', 'false', 'n', 'no']:
return False
raise ValueError('Unable to parse value: {}'.format(bool_string))

0 comments on commit d5adaed

Please sign in to comment.