mercurial/encoding.py
changeset 28507 9bcbd9412225
parent 28069 b2d24c2898f9
child 28508 3c6e94d0811c
--- a/mercurial/encoding.py	Fri Mar 11 10:28:58 2016 +0000
+++ b/mercurial/encoding.py	Fri Mar 11 21:23:34 2016 -0800
@@ -10,12 +10,16 @@
 import array
 import locale
 import os
+import sys
 import unicodedata
 
 from . import (
     error,
 )
 
+if sys.version_info[0] >= 3:
+    unichr = chr
+
 # These unicode characters are ignored by HFS+ (Apple Technote 1150,
 # "Unicode Subtleties"), so we need to ignore them in some places for
 # sanity.
@@ -23,7 +27,10 @@
            "200c 200d 200e 200f 202a 202b 202c 202d 202e "
            "206a 206b 206c 206d 206e 206f feff".split()]
 # verify the next function will work
-assert set([i[0] for i in _ignore]) == set(["\xe2", "\xef"])
+if sys.version_info[0] >= 3:
+    assert set(i[0] for i in _ignore) == set([ord(b'\xe2'), ord(b'\xef')])
+else:
+    assert set(i[0] for i in _ignore) == set(["\xe2", "\xef"])
 
 def hfsignoreclean(s):
     """Remove codepoints ignored by HFS+ from s.