Fix charmapencode_lookup(), so that a None value in the mapping
is treated as "character maps to <undefined>" and not as "character mapping must return integer, None or str".
This commit is contained in:
parent
6757c1e856
commit
adc727490b
@ -2736,6 +2736,8 @@ static PyObject *charmapencode_lookup(Py_UNICODE c, PyObject *mapping)
|
|||||||
} else
|
} else
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
else if (x == Py_None)
|
||||||
|
return x;
|
||||||
else if (PyInt_Check(x)) {
|
else if (PyInt_Check(x)) {
|
||||||
long value = PyInt_AS_LONG(x);
|
long value = PyInt_AS_LONG(x);
|
||||||
if (value < 0 || value > 255) {
|
if (value < 0 || value > 255) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user