diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-01-28 18:18:01 +0000 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-01-28 18:18:01 +0000 |
| commit | f9ea6196139fed76a8cf65bccfdc2c34c1e8ce91 (patch) | |
| tree | 94938e26e6850d5049881f189dda05fbae712543 | |
| parent | d6d4d60109af87889e57ee263f64d2f7955890c3 (diff) | |
Fixed #12099 -- Prevented admindocs from crashing when an application that provides template tags libraries is packaged as an egg. These libraries will be ignored.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17401 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/contrib/admindocs/views.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/django/contrib/admindocs/views.py b/django/contrib/admindocs/views.py index a16cfe9755..33d9a7da2b 100644 --- a/django/contrib/admindocs/views.py +++ b/django/contrib/admindocs/views.py @@ -307,11 +307,14 @@ def load_all_installed_template_libraries(): # Load/register all template tag libraries from installed apps. for module_name in template.get_templatetags_modules(): mod = import_module(module_name) - libraries = [ - os.path.splitext(p)[0] - for p in os.listdir(os.path.dirname(mod.__file__)) - if p.endswith('.py') and p[0].isalpha() - ] + try: + libraries = [ + os.path.splitext(p)[0] + for p in os.listdir(os.path.dirname(mod.__file__)) + if p.endswith('.py') and p[0].isalpha() + ] + except OSError: + libraries = [] for library_name in libraries: try: lib = template.get_library(library_name) |
