Skip to content

Commit

Permalink
refactor: we no longer need to support g2p<=0.5.20211029 imports
Browse files Browse the repository at this point in the history
  • Loading branch information
joanise authored and roedoejet committed Feb 28, 2023
1 parent a1f3c5d commit 04eb40e
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions readalongs/text/convert_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,7 @@ def convert_words( # noqa: C901

# Defer expensive import of g2p to do them only if and when they are needed
from g2p.mappings.langs.utils import is_arpabet

try:
# g2p > 0.5.20211029 uses its own exceptions for make_g2p errors
from g2p import InvalidLanguageCode, NoPath, make_g2p
except ImportError:
# g2p <= 0.5.20211029 used NetworkXNoPath and FileNotFoundError
from g2p import NetworkXNoPath as NoPath
from g2p import make_g2p

InvalidLanguageCode = FileNotFoundError
from g2p import InvalidLanguageCode, NoPath, make_g2p

# Warning counts so we don't flood the logs (unless verbose_warnings is set)
g2p_fallback_warning_count = 0
Expand Down

0 comments on commit 04eb40e

Please sign in to comment.