summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-07-20 16:36:21 (GMT)
committerGuido van Rossum <guido@python.org>2001-07-20 16:36:21 (GMT)
commit0d42e0c54a3b95aec4d4d12d1cd758438d645089 (patch)
treef5670dfe504c6e99d3b6c09b9bccdde2d8376fad
parent9079164bdfb71c820c0216d37686960aa226c82b (diff)
downloadcpython-0d42e0c54a3b95aec4d4d12d1cd758438d645089.zip
cpython-0d42e0c54a3b95aec4d4d12d1cd758438d645089.tar.gz
cpython-0d42e0c54a3b95aec4d4d12d1cd758438d645089.tar.bz2
#ifdef out generation of \U escapes unless Py_UNICODE_WIDE. This
#caused warnings with the VMS C compiler. (SF bug #442998, in part.) On a narrow system the current code should never be executed since ch will always be < 0x10000. Marc-Andre: you may end up fixing this a different way, since I believe you have plans to generate \U for surrogate pairs. I'll leave that to you.
-rw-r--r--Objects/unicodeobject.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 08e8089..a46df16 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -1441,6 +1441,7 @@ PyObject *unicodeescape_string(const Py_UNICODE *s,
*p++ = '\\';
*p++ = (char) ch;
}
+#ifdef Py_UNICODE_WIDE
/* Map 21-bit characters to '\U00xxxxxx' */
else if (ch >= 0x10000) {
*p++ = '\\';
@@ -1454,6 +1455,7 @@ PyObject *unicodeescape_string(const Py_UNICODE *s,
*p++ = hexdigit[(ch >> 4) & 0xf];
*p++ = hexdigit[ch & 15];
}
+#endif
/* Map 16-bit characters to '\uxxxx' */
else if (ch >= 256) {
*p++ = '\\';