[Erp5-report] r41642 nicolas - /erp5/trunk/products/ERP5Type/Utils.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Dec 22 10:08:41 CET 2010


Author: nicolas
Date: Wed Dec 22 10:08:41 2010
New Revision: 41642

URL: http://svn.erp5.org?rev=41642&view=rev
Log:
InvaliUrl Exception is only available from urlnorm version 1.0.1


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=41642&r1=41641&r2=41642&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Utils.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Utils.py [utf8] Wed Dec 22 10:08:41 2010
@@ -3254,11 +3254,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 (AttributeError, urlnorm.InvalidUrl):
-    # This url is not valid, a better Exception will
-    # be raised
+  except InvalidURLException:
+    # This url is not valid
     return
   url_split = urlparse.urlsplit(url)
   url_protocol = url_split[0]



More information about the Erp5-report mailing list