mirror of
https://github.com/python/cpython.git
synced 2025-08-17 07:11:51 +00:00
Issue #13093: Fix error handling on PyUnicode_EncodeDecimal()
Add tests for PyUnicode_EncodeDecimal()
This commit is contained in:
parent
5aa7df320f
commit
975134e2a2
3 changed files with 64 additions and 4 deletions
|
@ -5160,11 +5160,10 @@ int PyUnicode_EncodeDecimal(Py_UNICODE *s,
|
|||
}
|
||||
/* All other characters are considered unencodable */
|
||||
collstart = p;
|
||||
collend = p+1;
|
||||
while (collend < end) {
|
||||
for (collend = p+1; collend < end; collend++) {
|
||||
if ((0 < *collend && *collend < 256) ||
|
||||
!Py_UNICODE_ISSPACE(*collend) ||
|
||||
Py_UNICODE_TODECIMAL(*collend))
|
||||
Py_UNICODE_ISSPACE(*collend) ||
|
||||
0 <= Py_UNICODE_TODECIMAL(*collend))
|
||||
break;
|
||||
}
|
||||
/* cache callback name lookup
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue