[PATCH 07 of 13] Initial attempt to fix i18n unicode changes on Py3k. Work on progress

Martin Geisler mg at lazybytes.net
Wed Aug 5 17:35:14 CDT 2009


Alejandro Santos <alejolp at alejolp.com> writes:

> +def gettext3(message):
> +    """
> +    Translate message.
> +    """
> +    # If message is None, t.gettext will return 'None' as the
> +    # translation whereas our callers expect us to return None.
> +    if message is None:
> +        return message
>  
> +    try:
> +        return t.gettext(message)
> +    except LookupError:
> +        return message

The LookupError can be raised by the call to u.encode in gettext2, not
From t.gettext, so the except block is unnecessary. I've updated the
code in crew to explain this better (884964f99e07).

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial-devel/attachments/20090806/e0f703d4/attachment.pgp 


More information about the Mercurial-devel mailing list