[pypy-commit] pypy unicode-utf8-py3: merge heads

mattip pypy.commits at gmail.com
Sat Sep 1 10:59:39 EDT 2018


Author: Matti Picus <matti.picus at gmail.com>
Branch: unicode-utf8-py3
Changeset: r95067:9282b2668b8f
Date: 2018-09-01 16:50 +0200
http://bitbucket.org/pypy/pypy/changeset/9282b2668b8f/

Log:	merge heads

diff --git a/pypy/module/unicodedata/interp_ucd.py b/pypy/module/unicodedata/interp_ucd.py
--- a/pypy/module/unicodedata/interp_ucd.py
+++ b/pypy/module/unicodedata/interp_ucd.py
@@ -82,9 +82,9 @@
         sequence = self._lookup_named_sequence(code)
         if sequence is not None:
             # named sequences only contain UCS2 codes, no surrogates &co.
-            return space.newutf8(unichr_as_utf8(r_uint(code)), 1)
+            return space.newutf8(sequence.encode('utf-8'), len(sequence))
 
-
+        return space.newutf8(unichr_as_utf8(r_uint(code)), 1)
 
     def name(self, space, w_unichr, w_default=None):
         code = unichr_to_code_w(space, w_unichr)


More information about the pypy-commit mailing list