[pypy-commit] pypy py3.5: Bah, the version number of the unicode database we use must be fixed

arigo pypy.commits at gmail.com
Tue Jan 10 05:19:56 EST 2017


Author: Armin Rigo <arigo at tunes.org>
Branch: py3.5
Changeset: r89468:a3395285a8ad
Date: 2017-01-10 11:19 +0100
http://bitbucket.org/pypy/pypy/changeset/a3395285a8ad/

Log:	Bah, the version number of the unicode database we use must be fixed
	here too. Change the logic so that a single place is enough.

diff --git a/pypy/module/unicodedata/__init__.py b/pypy/module/unicodedata/__init__.py
--- a/pypy/module/unicodedata/__init__.py
+++ b/pypy/module/unicodedata/__init__.py
@@ -3,7 +3,8 @@
 # This is the default unicodedb used in various places:
 # - the unicode type
 # - the regular expression engine
-from rpython.rlib.unicodedata import unicodedb_6_1_0 as unicodedb
+from pypy.module.unicodedata.interp_ucd import ucd as _ucd
+unicodedb = _ucd._unicodedb
 
 # to get information about individual unicode chars look at:
 # http://www.fileformat.info/info/unicode/char/search.htm
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
@@ -77,6 +77,7 @@
 
 class UCD(W_Root):
     def __init__(self, unicodedb):
+        self._unicodedb = unicodedb
         self._lookup = unicodedb.lookup_with_alias
         self._lookup_named_sequence = unicodedb.lookup_named_sequence
         self._name = unicodedb.name
diff --git a/pypy/objspace/std/test/test_unicodeobject.py b/pypy/objspace/std/test/test_unicodeobject.py
--- a/pypy/objspace/std/test/test_unicodeobject.py
+++ b/pypy/objspace/std/test/test_unicodeobject.py
@@ -234,6 +234,9 @@
         assert ('\u019b\u1d00\u1d86\u0221\u1fb7'.capitalize() ==
                 '\u019b\u1d00\u1d86\u0221\u1fb7')
 
+    def test_changed_in_unicodedata_version_8(self):
+        assert u'\u025C'.upper() == u'\uA7AB'
+
     def test_isprintable(self):
         assert "".isprintable()
         assert " ".isprintable()


More information about the pypy-commit mailing list