diff --git a/django/core/management/commands/compilemessages.py b/django/core/management/commands/compilemessages.py index d1f1647f8b..7d600e0fe9 100644 --- a/django/core/management/commands/compilemessages.py +++ b/django/core/management/commands/compilemessages.py @@ -3,11 +3,6 @@ import sys from optparse import make_option from django.core.management.base import BaseCommand, CommandError -try: - set -except NameError: - from sets import Set as set # For Python 2.3 - def compile_messages(locale=None): basedirs = [os.path.join('conf', 'locale'), 'locale'] if os.environ.get('DJANGO_SETTINGS_MODULE'): diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py index 42e3bcc0d7..e6e0a61201 100644 --- a/django/utils/translation/trans_real.py +++ b/django/utils/translation/trans_real.py @@ -60,7 +60,7 @@ class DjangoTranslation(gettext_module.GNUTranslations): """ This class sets up the GNUTranslations context with regard to output charset. Django uses a defined DEFAULT_CHARSET as the output charset on - Python 2.4. With Python 2.3, use DjangoTranslation23. + Python 2.4. """ def __init__(self, *args, **kw): from django.conf import settings @@ -87,23 +87,6 @@ class DjangoTranslation(gettext_module.GNUTranslations): def __repr__(self): return "" % self.__language -class DjangoTranslation23(DjangoTranslation): - """ - Compatibility class that is only used with Python 2.3. - Python 2.3 doesn't support set_output_charset on translation objects and - needs this wrapper class to make sure input charsets from translation files - are correctly translated to output charsets. - - With a full switch to Python 2.4, this can be removed from the source. - """ - def gettext(self, msgid): - res = self.ugettext(msgid) - return res.encode(self.django_output_charset) - - def ngettext(self, msgid1, msgid2, n): - res = self.ungettext(msgid1, msgid2, n) - return res.encode(self.django_output_charset) - def translation(language): """ Returns a translation object. @@ -121,11 +104,6 @@ def translation(language): from django.conf import settings - # set up the right translation class - klass = DjangoTranslation - if sys.version_info < (2, 4): - klass = DjangoTranslation23 - globalpath = os.path.join(os.path.dirname(sys.modules[settings.__module__].__file__), 'locale') if settings.SETTINGS_MODULE is not None: @@ -147,7 +125,7 @@ def translation(language): def _translation(path): try: - t = gettext_module.translation('django', path, [loc], klass) + t = gettext_module.translation('django', path, [loc], DjangoTranslation) t.set_language(lang) return t except IOError, e: