Ticket #15084: patch

File patch, 1.3 KB (added by Klaas van Schelven, 12 years ago)

Deal w/ None as a return value of get_loader(); Django 1.4 line numbers

  • AUTHORS

    diff --git a/AUTHORS b/AUTHORS
    index ea0b019..16004ed 100644
    a b answer newbie questions, and generally made Django that much better:  
    578578    Gasper Zejn <zejn@kiberpipa.org>
    579579    Jarek Zgoda <jarek.zgoda@gmail.com>
    580580    Cheng Zhang
     581    Klaas van Schelven <klaas@vanschelven.com>
    581582
    582583A big THANK YOU goes to:
    583584
  • django/utils/translation/trans_real.py

    diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py
    index 0cd13fd..9185066 100644
    a b import sys  
    88import gettext as gettext_module
    99from io import StringIO
    1010from threading import local
     11import pkgutil
    1112
    1213from django.utils.importlib import import_module
    1314from django.utils.safestring import mark_safe, SafeData
    def translation(language):  
    147148            return res
    148149
    149150        for appname in reversed(settings.INSTALLED_APPS):
    150             app = import_module(appname)
    151             apppath = os.path.join(os.path.dirname(app.__file__), 'locale')
     151            app = pkgutil.get_loader(appname)
     152            if app is None:
     153                continue
     154            apppath = os.path.join(app.filename, 'locale')
    152155
    153156            if os.path.isdir(apppath):
    154157                res = _merge(apppath)
Back to Top