Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
  • Loading branch information...
commit f9ea6196139fed76a8cf65bccfdc2c34c1e8ce91 1 parent d6d4d60
Aymeric Augustin authored January 28, 2012

Showing 1 changed file with 8 additions and 5 deletions. Show diff stats Hide diff stats

  1. 13  django/contrib/admindocs/views.py
13  django/contrib/admindocs/views.py
@@ -307,11 +307,14 @@ def load_all_installed_template_libraries():
307 307
     # Load/register all template tag libraries from installed apps.
308 308
     for module_name in template.get_templatetags_modules():
309 309
         mod = import_module(module_name)
310  
-        libraries = [
311  
-            os.path.splitext(p)[0]
312  
-            for p in os.listdir(os.path.dirname(mod.__file__))
313  
-            if p.endswith('.py') and p[0].isalpha()
314  
-        ]
  310
+        try:
  311
+            libraries = [
  312
+                os.path.splitext(p)[0]
  313
+                for p in os.listdir(os.path.dirname(mod.__file__))
  314
+                if p.endswith('.py') and p[0].isalpha()
  315
+            ]
  316
+        except OSError:
  317
+            libraries = []
315 318
         for library_name in libraries:
316 319
             try:
317 320
                 lib = template.get_library(library_name)

0 notes on commit f9ea619

Please sign in to comment.
Something went wrong with that request. Please try again.