# HG changeset patch # User Martin Geisler # Date 1249511668 -7200 # Node ID 884964f99e0719d653aed9a20d5955590da32318 # Parent 8982eb292cb5adf3ddbed3bb9a16816f273fb259 i18n: move unrelated line out of try-except block diff -r 8982eb292cb5 -r 884964f99e07 mercurial/i18n.py --- a/mercurial/i18n.py Thu Aug 06 00:26:34 2009 +0200 +++ b/mercurial/i18n.py Thu Aug 06 00:34:28 2009 +0200 @@ -36,15 +36,16 @@ if message is None: return message + u = t.ugettext(message) try: # encoding.tolocal cannot be used since it will first try to # decode the Unicode string. Calling u.decode(enc) really # means u.encode(sys.getdefaultencoding()).decode(enc). Since # the Python encoding defaults to 'ascii', this fails if the # translated string use non-ASCII characters. - u = t.ugettext(message) return u.encode(encoding.encoding, "replace") except LookupError: + # An unknown encoding results in a LookupError. return message _ = gettext