Author: mtredinnick
Date: 2007-10-21 12:51:06 -0500 (Sun, 21 Oct 2007)
New Revision: 6584
Modified:
django/trunk/django/core/urlresolvers.py
Log:
Fixed #5732 -- Catch all possible errors when importing a URLConf file. This
leads to error messages that contain the name of the problem file (useful when
the problem is part of an include() import).
Modified: django/trunk/django/core/urlresolvers.py
===================================================================
--- django/trunk/django/core/urlresolvers.py 2007-10-21 17:26:32 UTC (rev
6583)
+++ django/trunk/django/core/urlresolvers.py 2007-10-21 17:51:06 UTC (rev
6584)
@@ -249,8 +249,9 @@
except AttributeError:
try:
self._urlconf_module = __import__(self.urlconf_name, {}, {},
[''])
- except ValueError, e:
- # Invalid urlconf_name, such as "foo.bar." (note trailing
period)
+ except Exception, e:
+ # Either an invalid urlconf_name, such as "foo.bar.", or some
+ # kind of problem during the actual import.
raise ImproperlyConfigured, "Error while importing URLconf %r:
%s" % (self.urlconf_name, e)
return self._urlconf_module
urlconf_module = property(_get_urlconf_module)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---