Skip to content

Commit

Permalink
Skip non matching bible verses correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnlentink committed Mar 21, 2024
1 parent a723021 commit d7d6e75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bible_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def parse_verse_numbers(verse_label: str):

def extract_verse(inp: str):
matches = re.match(r"(?P<verse_int>\d+)(?P<verse_alpha>[a-z])?", inp.strip())
return (int(matches["verse_int"]), matches["verse_alpha"])
return (int(matches["verse_int"]), matches["verse_alpha"]) if matches else None

# in the exceptional translations where verses are returned in ranges
if "-" in verse_input:
Expand Down

0 comments on commit d7d6e75

Please sign in to comment.