[cwconfig] Trim down allowed exceptions in gettext language setting
authorDenis Laxalde <denis.laxalde@logilab.fr>
Thu, 17 Nov 2016 11:03:19 +0100
changeset 11857 a166ddb503aa
parent 11856 92e9cbc6fc57
child 11858 b2ceb483e056
[cwconfig] Trim down allowed exceptions in gettext language setting I can't see any valid reason to pass on ImportError and AttributeError. In particular, the latter shadowed a Python 3 error until 4f43e64603ef.
cubicweb/cwconfig.py
--- a/cubicweb/cwconfig.py	Mon Nov 21 14:52:33 2016 +0100
+++ b/cubicweb/cwconfig.py	Thu Nov 17 11:03:19 2016 +0100
@@ -1304,7 +1304,7 @@
             try:
                 tr = translation('cubicweb', path, languages=[language])
                 self.translations[language] = (tr.ugettext, tr.upgettext)
-            except (ImportError, AttributeError, IOError):
+            except IOError:
                 if self.mode != 'test':
                     # in test contexts, data/i18n does not exist, hence
                     # logging will only pollute the logs