# HG changeset patch # User Denis Laxalde # Date 1479376072 -3600 # Node ID 4f43e64603ef446603bda11a349b77538ade290a # Parent adf0212d1dcc4a311492a3beb70cc977a2a3fb38 Alias ugettext to gettext method of cwGNUTranslations in Python 3 The former does not exist in Python 3, but we rely on it. This fixes test_login_bad_password in cubicweb/pyramid/test/test_login.py which has never passed since being introduced in 6392f34fcdad. diff -r adf0212d1dcc -r 4f43e64603ef cubicweb/cwgettext.py --- a/cubicweb/cwgettext.py Wed Nov 16 14:38:11 2016 +0100 +++ b/cubicweb/cwgettext.py Thu Nov 17 10:47:52 2016 +0100 @@ -18,6 +18,8 @@ import gettext +from six import PY3 + class cwGNUTranslations(gettext.GNUTranslations): # The encoding of a msgctxt and a msgid in a .mo file is @@ -83,6 +85,9 @@ else: return msgid2 + if PY3: + ugettext = gettext.GNUTranslations.gettext + def upgettext(self, context, message): ctxt_message_id = self.CONTEXT_ENCODING % (context, message) missing = object()