From 88abfb3811d1c5cf6cdb7d84c00cc480120bca05 Mon Sep 17 00:00:00 2001 From: Julien Muchembled <jm@nexedi.com> Date: Fri, 24 Dec 2010 15:51:55 +0000 Subject: [PATCH] Revert [41642] ("InvaliUrl Exception is only available from urlnorm version 1.0.1") InvalidUrl exception already exists in version 1.0 git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41757 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Type/Utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/product/ERP5Type/Utils.py b/product/ERP5Type/Utils.py index 2a3dfe2360..116dbbd241 100644 --- a/product/ERP5Type/Utils.py +++ b/product/ERP5Type/Utils.py @@ -3255,11 +3255,11 @@ def legacyNormalizeUrl(url, base_url=None): 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] -- 2.30.9