Ticket #23525: 23525.diff

File 23525.diff, 1.3 KB (added by Tim Graham, 10 years ago)
  • django/contrib/admindocs/views.py

    diff --git a/django/contrib/admindocs/views.py b/django/contrib/admindocs/views.py
    index 1768fd7..bf706d0 100644
    a b def load_all_installed_template_libraries():  
    315315    # Load/register all template tag libraries from installed apps.
    316316    for module_name in template.get_templatetags_modules():
    317317        mod = import_module(module_name)
     318        if not hasattr(mod, '__file__'):
     319            # e.g. packages installed as eggs
     320            continue
     321
    318322        try:
    319323            libraries = [
    320324                os.path.splitext(p)[0]
    def load_all_installed_template_libraries():  
    322326                if p.endswith('.py') and p[0].isalpha()
    323327            ]
    324328        except OSError:
    325             libraries = []
    326         for library_name in libraries:
    327             try:
    328                 template.get_library(library_name)
    329             except template.InvalidTemplateLibrary:
    330                 pass
     329            continue
     330        else:
     331            for library_name in libraries:
     332                try:
     333                    template.get_library(library_name)
     334                except template.InvalidTemplateLibrary:
     335                    pass
    331336
    332337
    333338def get_return_data_type(func_name):
Back to Top