From 22d7e84b95869dd4300952b88113dd00e53e9ec7 Mon Sep 17 00:00:00 2001 From: Maksym Shalenyi Date: Fri, 27 Jan 2023 14:47:04 -0800 Subject: Update import order for unidecode vs text_unidecode (#126) AS is `text_unidecode` is install_requires it is always present in the python environment, it makes sense to try import optinal dependency `unidecode` first, and only then fallback to `text_unidecode`. --- slugify/slugify.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slugify/slugify.py b/slugify/slugify.py index b8c02ad..5354fa5 100644 --- a/slugify/slugify.py +++ b/slugify/slugify.py @@ -4,9 +4,9 @@ import unicodedata from html.entities import name2codepoint try: - import text_unidecode as unidecode -except ImportError: import unidecode +except ImportError: + import text_unidecode as unidecode __all__ = ['slugify', 'smart_truncate'] -- cgit v1.2.1