Skip to content

Commit

Permalink
parse arg being empty string to be false
Browse files Browse the repository at this point in the history
Signed-off-by: HuiyingLi <willwin.lee@gmail.com>
  • Loading branch information
HuiyingLi committed Oct 1, 2024
1 parent c6ea077 commit 7303c70
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/export/nemo_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,8 @@ def str_to_bool(name: str, s: str, optional: bool = False) -> Optional[bool]:
s = s.lower()
true_strings = ["true", "1"]
false_strings = ["false", "0"]
if s == '':
return False
if s in true_strings:
return True
if s in false_strings:
Expand Down

0 comments on commit 7303c70

Please sign in to comment.