From 04eb40ee20fb1ac654f0fbbe270c9ddf50d842cf Mon Sep 17 00:00:00 2001 From: Eric Joanis Date: Tue, 28 Feb 2023 13:30:58 -0500 Subject: [PATCH] refactor: we no longer need to support g2p<=0.5.20211029 imports --- readalongs/text/convert_xml.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/readalongs/text/convert_xml.py b/readalongs/text/convert_xml.py index a69817aa..115caf54 100644 --- a/readalongs/text/convert_xml.py +++ b/readalongs/text/convert_xml.py @@ -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