summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/unicodeobject.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 748508b..0da565a 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -7525,9 +7525,10 @@ Error:
/* Apply mapping */
if (PyLong_Check(x)) {
long value = PyLong_AS_LONG(x);
- if (value < 0 || value > 65535) {
- PyErr_SetString(PyExc_TypeError,
- "character mapping must be in range(65536)");
+ if (value < 0 || value > MAX_UNICODE) {
+ PyErr_Format(PyExc_TypeError,
+ "character mapping must be in range(0x%lx)",
+ (unsigned long)MAX_UNICODE + 1);
Py_DECREF(x);
goto onError;
}