From 63ab875cfefc0f1f4e123f4d9c885b3079446f35 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 22 Nov 2011 03:31:20 +0100 Subject: Remove "#ifdef Py_UNICODE_WIDE": Python is now always wide --- Python/bltinmodule.c | 11 ++--------- Python/traceback.c | 10 ++-------- 2 files changed, 4 insertions(+), 17 deletions(-) (limited to 'Python') diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 871eaa3497..13349cc7bb 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -518,17 +518,10 @@ builtin_chr(PyObject *self, PyObject *args) return PyUnicode_FromOrdinal(x); } -PyDoc_VAR(chr_doc) = PyDoc_STR( +PyDoc_STRVAR(chr_doc, "chr(i) -> Unicode character\n\ \n\ -Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff." -) -#ifndef Py_UNICODE_WIDE -PyDoc_STR( -"\nIf 0x10000 <= i, a surrogate pair is returned." -) -#endif -; +Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff."); static char * diff --git a/Python/traceback.c b/Python/traceback.c index 2f4653bce6..c8b3ee1b63 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -526,23 +526,17 @@ dump_ascii(int fd, PyObject *text) char c = (char)ch; write(fd, &c, 1); } - else if (ch < 256) { + else if (ch < 0xff) { PUTS(fd, "\\x"); dump_hexadecimal(2, ch, fd); } - else -#ifdef Py_UNICODE_WIDE - if (ch < 65536) -#endif - { + else if (ch < 0xffff) { PUTS(fd, "\\u"); dump_hexadecimal(4, ch, fd); -#ifdef Py_UNICODE_WIDE } else { PUTS(fd, "\\U"); dump_hexadecimal(8, ch, fd); -#endif } } if (truncated) -- cgit v1.2.1