diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-08-18 17:47:21 +0200 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-08-18 17:51:16 +0200 |
| commit | afc1bd7ab87268b33a8b44b3238f562cdaf2a72f (patch) | |
| tree | 6b434993c1e4113f8a1c724f7e05a6e6e22873c0 /django/utils/text.py | |
| parent | de3ad8bb2d14ccf878121b96e6e0359dd8b1f9d5 (diff) | |
[py3] Made 212b9826bd Python 3-friendly
Diffstat (limited to 'django/utils/text.py')
| -rw-r--r-- | django/utils/text.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/django/utils/text.py b/django/utils/text.py index cbafab0032..ca79a24f7c 100644 --- a/django/utils/text.py +++ b/django/utils/text.py @@ -391,7 +391,7 @@ def slugify(value): underscores) and converts spaces to hyphens. Also strips leading and trailing whitespace. """ - value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore') - value = unicode(re.sub('[^\w\s-]', '', value).strip().lower()) + value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore').decode('ascii') + value = re.sub('[^\w\s-]', '', value).strip().lower() return mark_safe(re.sub('[-\s]+', '-', value)) -slugify = allow_lazy(slugify, unicode) +slugify = allow_lazy(slugify, six.text_type) |
