summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_gdb.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-09-08 21:57:37 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-09-08 21:57:37 (GMT)
commit7c9cf01238cdfb597041d12e71d5a11a98402b34 (patch)
treeaefbf95baaf6c169e0c256261e742547610e1b3f /Lib/test/test_gdb.py
parentb1856d7fa74e045473a530197a0dedd9052a5e95 (diff)
downloadcpython-7c9cf01238cdfb597041d12e71d5a11a98402b34.zip
cpython-7c9cf01238cdfb597041d12e71d5a11a98402b34.tar.gz
cpython-7c9cf01238cdfb597041d12e71d5a11a98402b34.tar.bz2
gdb: fix representation of non-printable surrogate pairs, and workaround
a bug in ascii().
Diffstat (limited to 'Lib/test/test_gdb.py')
-rw-r--r--Lib/test/test_gdb.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py
index bac8d36..d80acfe 100644
--- a/Lib/test/test_gdb.py
+++ b/Lib/test/test_gdb.py
@@ -234,7 +234,9 @@ class PrettyPrintTests(DebuggerTests):
text.encode(encoding)
printable = True
except UnicodeEncodeError:
- self.assertGdbRepr(text, ascii(text))
+ # Workaround ascii() bug on UCS-2 builds: issue #9804
+ asc = "'" + text.encode('unicode-escape').decode('ascii') + "'"
+ self.assertGdbRepr(text, asc)
else:
self.assertGdbRepr(text)