mercurial/debugcommands.py
changeset 34129 902219a99901
parent 34120 07f09995e857
child 34130 ada8a19672ab
--- a/mercurial/debugcommands.py	Sun Sep 10 23:37:14 2017 +0900
+++ b/mercurial/debugcommands.py	Thu Sep 07 22:27:23 2017 +0900
@@ -7,6 +7,7 @@
 
 from __future__ import absolute_import
 
+import codecs
 import collections
 import difflib
 import errno
@@ -997,8 +998,8 @@
     fm.write('encoding', _("checking encoding (%s)...\n"), encoding.encoding)
     err = None
     try:
-        encoding.fromlocal("test")
-    except error.Abort as inst:
+        codecs.lookup(pycompat.sysstr(encoding.encoding))
+    except LookupError as inst:
         err = inst
         problems += 1
     fm.condwrite(err, 'encodingerror', _(" %s\n"