Skip to content

Commit

Permalink
Merge pull request #36 from baseplate-admin/main
Browse files Browse the repository at this point in the history
Use contextlib.suppress instead of empty pass
  • Loading branch information
hitblast authored May 9, 2024
2 parents 2b0cc1a + 2f6581b commit 570f1ab
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions avro/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


# Import first-party Python libraries.
import contextlib
import re
from concurrent.futures import ThreadPoolExecutor, as_completed
from functools import lru_cache
Expand Down Expand Up @@ -327,15 +328,12 @@ def _reverse_with_rules(cursor: int, fixed_text: str, text_reversed: str) -> str
):
added_suffix = "o"

try:
with contextlib.suppress(IndexError):
if (fixed_text[cursor + 1] in config.AVRO_KAR) or (
fixed_text[cursor + 2] in config.AVRO_KAR and not cursor == 0
):
added_suffix = ""

except IndexError:
pass

return text_reversed if not text_reversed else text_reversed + added_suffix


Expand Down

0 comments on commit 570f1ab

Please sign in to comment.