diff options
| author | bolkedebruin <bolkedebruin@users.noreply.github.com> | 2018-03-25 03:48:47 +0200 |
|---|---|---|
| committer | Val Neekman <un33kvu@gmail.com> | 2018-03-24 21:48:47 -0400 |
| commit | 874fe140aa68ee1065e2170385f8c4ace5ac644a (patch) | |
| tree | 955640a1612c32b7c45673f3f011191c2e3ed307 /slugify | |
| parent | e14bde218d794869eba8d23949bf0a9de8611a46 (diff) | |
| download | python-slugify-874fe140aa68ee1065e2170385f8c4ace5ac644a.tar.gz | |
Use unidecode as an API and allow alternatives (#53)
This PR allows specifying WITH_TEXTUNIDECODE when
installing python-slugify. This allows using
text-unidecode instead of unidecode. It will default
to using unidecode.
Closes: #51
Diffstat (limited to 'slugify')
| -rw-r--r-- | slugify/slugify.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/slugify/slugify.py b/slugify/slugify.py index af0c609..8619184 100644 --- a/slugify/slugify.py +++ b/slugify/slugify.py @@ -13,8 +13,10 @@ except ImportError: _unicode_type = str unichr = chr -import unidecode - +try: + import unidecode +except ImportError: + import text_unidecode as unidecode __all__ = ['slugify', 'smart_truncate'] |
