summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaksym Shalenyi <maksym.shalenyi@crunch.io>2023-01-27 14:47:04 -0800
committerGitHub <noreply@github.com>2023-01-27 17:47:04 -0500
commit22d7e84b95869dd4300952b88113dd00e53e9ec7 (patch)
tree0f1cb6c1e80ad6e31de3cef20f0632e7446be31e
parent93d15b7f07c748e86d831f9268e04e80f807224a (diff)
downloadpython-slugify-22d7e84b95869dd4300952b88113dd00e53e9ec7.tar.gz
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`.
-rw-r--r--slugify/slugify.py4
1 files 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']