diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-05-20 11:29:45 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-05-20 11:29:45 (GMT) |
commit | b1556c537d7c49978fa40594a9c9f40c6f88cdde (patch) | |
tree | dee0eb7ce8283451d3e407ce1b299094e93acafd /Lib | |
parent | 8f692275e9c2cd4e5f7959328f6f9da8538ffe9e (diff) | |
download | cpython-b1556c537d7c49978fa40594a9c9f40c6f88cdde.zip cpython-b1556c537d7c49978fa40594a9c9f40c6f88cdde.tar.gz cpython-b1556c537d7c49978fa40594a9c9f40c6f88cdde.tar.bz2 |
libpython.py: fix support of non-BMP unicode characters
Forward port some code from Python3:
* join surrogate pairs if sizeof(Py_UNICODE)==2
* Enable non-BMP test on narrow builds using u"\U0001D121" instead of
unichr(0x1D121)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_gdb.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index 388f240..2a7057c 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -243,14 +243,8 @@ class PrettyPrintTests(DebuggerTests): # This is: # UTF-8: 0xF0 0x9D 0x84 0xA1 # UTF-16: 0xD834 0xDD21 - try: - # This will only work on wide-unicode builds: - self.assertGdbRepr(unichr(0x1D121)) - except ValueError, e: - # We're probably on a narrow-unicode build; if we're seeing a - # different problem, then re-raise it: - if e.args != ('unichr() arg not in range(0x10000) (narrow Python build)',): - raise e + # This will only work on wide-unicode builds: + self.assertGdbRepr(u"\U0001D121") def test_sets(self): 'Verify the pretty-printing of sets' |