Commits

Martijn Pieters committed f91d32f

Accessing CODESET in the locale module could result in an AttributeError here

  • Participants
  • Parent commits f7a6fc2

Comments (0)

Files changed (1)

pending/getpreferredencoding.patch

 # HG changeset patch
 # Parent d59a623cc4c931af084b8696cc6ed896d583701e
 # User Martijn Pieters <mj@zopatista.com>
-# Date 1281728422 -7200
+# Date 1281728933 -7200
 
 Use the POSIX version of getpreferredencoding on Mac, see http://bugs.python.org/issue6203
 
-
 diff --git a/mercurial/encoding.py b/mercurial/encoding.py
 --- a/mercurial/encoding.py
 +++ b/mercurial/encoding.py
 +    # Python versions.
 +    try:
 +        locale.CODESET
-+    except NameError:
++    except AttributeError:
 +        # Fall back to parsing environment variables :-(
 +        def getpreferredencoding(do_setlocale = True):
 +            """Return the charset that the user is likely using,