summaryrefslogtreecommitdiffstats
path: root/Modules/cjkcodecs/cjkcodecs.h
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-07-16 19:41:43 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-07-16 19:41:43 (GMT)
commitd1f9942ae399c765c1bee392658fc0f56f963ec5 (patch)
tree6d566256fb6d1c9edae6257bb612e1d867e58058 /Modules/cjkcodecs/cjkcodecs.h
parent85c761d3d3357615da15b332df36b307c70e2acb (diff)
downloadcpython-d1f9942ae399c765c1bee392658fc0f56f963ec5.zip
cpython-d1f9942ae399c765c1bee392658fc0f56f963ec5.tar.gz
cpython-d1f9942ae399c765c1bee392658fc0f56f963ec5.tar.bz2
Issue #18408: Fix cjkcodecs decoders, add a new MBERR_EXCEPTION constant to
notify exceptions raised by the _PyUnicodeWriter API
Diffstat (limited to 'Modules/cjkcodecs/cjkcodecs.h')
-rw-r--r--Modules/cjkcodecs/cjkcodecs.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/cjkcodecs/cjkcodecs.h b/Modules/cjkcodecs/cjkcodecs.h
index 18cc02f..9e92db2 100644
--- a/Modules/cjkcodecs/cjkcodecs.h
+++ b/Modules/cjkcodecs/cjkcodecs.h
@@ -130,7 +130,7 @@ static const struct dbcs_map *mapping_list;
#define OUTCHAR(c) \
do { \
if (_PyUnicodeWriter_WriteChar(writer, (c)) < 0) \
- return MBERR_TOOSMALL; \
+ return MBERR_EXCEPTION; \
} while (0)
#define OUTCHAR2(c1, c2) \
@@ -138,7 +138,7 @@ static const struct dbcs_map *mapping_list;
Py_UCS4 _c1 = (c1); \
Py_UCS4 _c2 = (c2); \
if (_PyUnicodeWriter_Prepare(writer, 2, Py_MAX(_c1, c2)) < 0) \
- return MBERR_TOOSMALL; \
+ return MBERR_EXCEPTION; \
PyUnicode_WRITE(writer->kind, writer->data, writer->pos, _c1); \
PyUnicode_WRITE(writer->kind, writer->data, writer->pos + 1, _c2); \
writer->pos += 2; \