[Erp5-report] r41757 jm - /erp5/trunk/products/ERP5Type/Utils.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Dec 24 16:51:55 CET 2010


Author: jm
Date: Fri Dec 24 16:51:55 2010
New Revision: 41757

URL: http://svn.erp5.org?rev=41757&view=rev
Log:
Revert [41642] ("InvaliUrl Exception is only available from urlnorm version 1.0.1")

InvalidUrl exception already exists in version 1.0

Modified:
    erp5/trunk/products/ERP5Type/Utils.py

Modified: erp5/trunk/products/ERP5Type/Utils.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Utils.py?rev=41757&r1=41756&r2=41757&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Utils.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Utils.py [utf8] Fri Dec 24 16:51:55 2010
@@ -3255,11 +3255,11 @@ def legacyNormalizeUrl(url, base_url=Non
 def urlnormNormaliseUrl(url, base_url=None):
   """The normalisation up is delegated to urlnorm library.
   """
-  InvalidURLException = getattr(urlnorm, 'InvalidUrl', AttributeError)
   try:
     url = urlnorm.norm(url)
-  except InvalidURLException:
-    # This url is not valid
+  except (AttributeError, urlnorm.InvalidUrl):
+    # This url is not valid, a better Exception will
+    # be raised
     return
   url_split = urlparse.urlsplit(url)
   url_protocol = url_split[0]



More information about the Erp5-report mailing list