Ticket #17304: trans_real.patch

File trans_real.patch, 869 bytes (added by rwmcfa1@…, 12 years ago)

patch that addresses the problem by using hasattr

  • django/utils/translation/trans_real.py

     
    158158
    159159        for appname in reversed(settings.INSTALLED_APPS):
    160160            app = import_module(appname)
    161             apppath = os.path.join(os.path.dirname(app.__file__), 'locale')
     161            if hasattr(app, '__file__'):
     162                apppath = os.path.join(os.path.dirname(app.__file__), 'locale')
    162163
    163             if os.path.isdir(apppath):
    164                 res = _merge(apppath)
     164                if os.path.isdir(apppath):
     165                    res = _merge(apppath)
    165166
    166167        localepaths = [os.path.normpath(path) for path in settings.LOCALE_PATHS]
    167168        if (projectpath and os.path.isdir(projectpath) and
Back to Top