Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #5732 -- Catch all possible errors when importing a URLConf fil…

…e. This

leads to error messages that contain the name of the problem file (useful when
the problem is part of an include() import).


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6584 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit a1496b054a2b5182387053952980415543276f8f 1 parent 3ec6568
Malcolm Tredinnick authored October 21, 2007

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. 5  django/core/urlresolvers.py
5  django/core/urlresolvers.py
@@ -249,8 +249,9 @@ def _get_urlconf_module(self):
249 249
         except AttributeError:
250 250
             try:
251 251
                 self._urlconf_module = __import__(self.urlconf_name, {}, {}, [''])
252  
-            except ValueError, e:
253  
-                # Invalid urlconf_name, such as "foo.bar." (note trailing period)
  252
+            except Exception, e:
  253
+                # Either an invalid urlconf_name, such as "foo.bar.", or some
  254
+                # kind of problem during the actual import.
254 255
                 raise ImproperlyConfigured, "Error while importing URLconf %r: %s" % (self.urlconf_name, e)
255 256
             return self._urlconf_module
256 257
     urlconf_module = property(_get_urlconf_module)

0 notes on commit a1496b0

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