summaryrefslogtreecommitdiff
path: root/Python/fileutils.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-11-12 16:48:25 -0500
committerBenjamin Peterson <benjamin@python.org>2012-11-12 16:48:25 -0500
commit9845da8acd3a38eabc247666f9968d3db78a7bdc (patch)
tree09badcc5e6d41892fb97db0ff41c5760fa000fe8 /Python/fileutils.c
parent79b2bfe430a7ab9493f737ce2eddb080170dd0e5 (diff)
parentcabe5e76cfca05fc7dc4b67c252af57ce8d74474 (diff)
downloadcpython-9845da8acd3a38eabc247666f9968d3db78a7bdc.tar.gz
merge 3.3
Diffstat (limited to 'Python/fileutils.c')
-rw-r--r--Python/fileutils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/fileutils.c b/Python/fileutils.c
index 976c04b117..2e25aae075 100644
--- a/Python/fileutils.c
+++ b/Python/fileutils.c
@@ -86,7 +86,7 @@ _Py_char2wchar(const char* arg, size_t *size)
/* Only use the result if it contains no
surrogate characters. */
for (tmp = res; *tmp != 0 &&
- (*tmp < 0xd800 || *tmp > 0xdfff); tmp++)
+ !Py_UNICODE_IS_SURROGATE(*tmp); tmp++)
;
if (*tmp == 0) {
if (size != NULL)
@@ -132,7 +132,7 @@ _Py_char2wchar(const char* arg, size_t *size)
memset(&mbs, 0, sizeof mbs);
continue;
}
- if (*out >= 0xd800 && *out <= 0xdfff) {
+ if (Py_UNICODE_IS_SURROGATE(*out)) {
/* Surrogate character. Escape the original
byte sequence with surrogateescape. */
argsize -= converted;