mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
Bug #2388: Fix gcc warnings when compiling with --enable-unicode=ucs4.
This commit is contained in:
parent
295814e463
commit
d918e4e068
3 changed files with 25 additions and 6 deletions
|
@ -740,9 +740,17 @@ do_conversion(PyObject *obj, STRINGLIB_CHAR conversion)
|
|||
case 's':
|
||||
return STRINGLIB_TOSTR(obj);
|
||||
default:
|
||||
PyErr_Format(PyExc_ValueError,
|
||||
"Unknown converion specifier %c",
|
||||
conversion);
|
||||
if (conversion > 32 && conversion < 127) {
|
||||
/* It's the ASCII subrange; casting to char is safe
|
||||
(assuming the execution character set is an ASCII
|
||||
superset). */
|
||||
PyErr_Format(PyExc_ValueError,
|
||||
"Unknown conversion specifier %c",
|
||||
(char)conversion);
|
||||
} else
|
||||
PyErr_Format(PyExc_ValueError,
|
||||
"Unknown conversion specifier \\x%x",
|
||||
(unsigned int)conversion);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue