From 62c3f6362ad46946ec9cc37554026897f1ea9452 Mon Sep 17 00:00:00 2001 From: Ramiro Morales Date: Wed, 15 Aug 2012 23:08:16 -0300 Subject: [PATCH] Fix changes introduced in fd04e7 so they don't break on Python 3. --- django/utils/text.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/django/utils/text.py b/django/utils/text.py index 10a071510f..ddeb29f2d2 100644 --- a/django/utils/text.py +++ b/django/utils/text.py @@ -1,15 +1,18 @@ from __future__ import unicode_literals import re +from django.utils import six import unicodedata import warnings from gzip import GzipFile from django.utils.six.moves import html_entities from io import BytesIO -# Import force_unicode even though this module doesn't use it, because some -# people rely on it being here. -from django.utils.encoding import force_text, force_unicode +from django.utils.encoding import force_text +if not six.PY3: + # Import force_unicode even though this module doesn't use it, because some + # people rely on it being here. + from django.utils.encoding import force_unicode from django.utils.functional import allow_lazy, SimpleLazyObject from django.utils import six from django.utils.translation import ugettext_lazy, ugettext as _, pgettext