Skip to content

Commit

Permalink
Merge pull request #681 from dangne/master
Browse files Browse the repository at this point in the history
Improve exception handling for WordSwapChangeNumber
  • Loading branch information
jxmorris12 authored Aug 13, 2022
2 parents 38aa2a2 + d938eb7 commit 2ac1bcb
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def _get_new_number(self, word):
num = w2n.word_to_num(word)
num_list = self._alter_number(num)
return [num2words(n) for n in num_list]
except ValueError:
except (ValueError, IndexError):
return []

def _alter_number(self, num):
Expand Down

0 comments on commit 2ac1bcb

Please sign in to comment.