Mercurial > public > mercurial-scm > hg
diff mercurial/i18n.py @ 7948:de377b1a9a84
move encoding bits from util to encoding
In addition to cleaning up util, this gets rid of some circular dependencies.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 03 Apr 2009 14:51:48 -0500 |
parents | 5b5036ef847a |
children | 46293a0c7e9f |
line wrap: on
line diff
--- a/mercurial/i18n.py Fri Apr 03 13:20:52 2009 -0500 +++ b/mercurial/i18n.py Fri Apr 03 14:51:48 2009 -0500 @@ -7,7 +7,7 @@ of the GNU General Public License, incorporated herein by reference. """ -import gettext, sys, os +import gettext, sys, os, encoding # modelled after templater.templatepath: if hasattr(sys, 'frozen'): @@ -37,15 +37,13 @@ if message is None: return message - # We cannot just run the text through util.tolocal since that - # leads to infinite recursion when util._encoding is invalid. + # We cannot just run the text through encoding.tolocal since that + # leads to infinite recursion when encoding._encoding is invalid. try: u = t.ugettext(message) - return u.encode(util._encoding, "replace") + return u.encode(encoding.encoding, "replace") except LookupError: return message _ = gettext -# Moved after _ because of circular import. -import util