From d63a3b8beb4a0841cb59fb3515347ccaab34b733 Mon Sep 17 00:00:00 2001 From: "Martin v. Löwis" Date: Wed, 28 Sep 2011 07:41:54 +0200 Subject: Implement PEP 393. --- Lib/test/test_codeccallbacks.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Lib/test/test_codeccallbacks.py') diff --git a/Lib/test/test_codeccallbacks.py b/Lib/test/test_codeccallbacks.py index c5b1e25c208..317ae44ccf9 100644 --- a/Lib/test/test_codeccallbacks.py +++ b/Lib/test/test_codeccallbacks.py @@ -1,5 +1,6 @@ import test.support, unittest import sys, codecs, html.entities, unicodedata +import ctypes class PosReturn: # this can be used for configurable callbacks @@ -577,8 +578,10 @@ class CodecCallbackTest(unittest.TestCase): UnicodeEncodeError("ascii", "\uffff", 0, 1, "ouch")), ("\\uffff", 1) ) - # 1 on UCS-4 builds, 2 on UCS-2 - len_wide = len("\U00010000") + if ctypes.sizeof(ctypes.c_wchar) == 2: + len_wide = 2 + else: + len_wide = 1 self.assertEqual( codecs.backslashreplace_errors( UnicodeEncodeError("ascii", "\U00010000", -- cgit v1.2.3