# HG changeset patch # User Denis Laxalde # Date 1479376999 -3600 # Node ID a166ddb503aa8184ff9dcdf6748de132fef87f93 # Parent 92e9cbc6fc57aca1083af84f8da7d9f98c8743f6 [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. diff -r 92e9cbc6fc57 -r a166ddb503aa 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