summaryrefslogtreecommitdiff
path: root/Python/fileutils.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-12-03 20:56:27 +0100
committerAntoine Pitrou <solipsis@pitrou.net>2012-12-03 20:56:27 +0100
commit3575597ccfa3f7a6cca57ee738198c4047a4cfce (patch)
treee35bbd931fa375177c19333dfeae9f74481479a3 /Python/fileutils.c
parentae0f016ce4eb72a3c4f18bb82a3f2fc9ae952dfa (diff)
parentb8547bd979ebb8ce16b64c4cf0fdf1e3d59f965a (diff)
downloadcpython-3575597ccfa3f7a6cca57ee738198c4047a4cfce.tar.gz
Split the bigmem re test in two separate tests with different memory requirements.
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 2e9ea359da..2cd75ce163 100644
--- a/Python/fileutils.c
+++ b/Python/fileutils.c
@@ -101,7 +101,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)
@@ -147,7 +147,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;