mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
fill_number() ensures that the 'digits' string is ready
This commit is contained in:
parent
afbaa20fb9
commit
dba2deeca2
1 changed files with 4 additions and 1 deletions
|
@ -587,7 +587,10 @@ fill_number(PyObject *out, Py_ssize_t pos, const NumberFieldWidths *spec,
|
|||
/* Only for type 'c' special case, it has no digits. */
|
||||
if (spec->n_digits != 0) {
|
||||
/* Fill the digits with InsertThousandsGrouping. */
|
||||
char *pdigits = PyUnicode_DATA(digits);
|
||||
char *pdigits;
|
||||
if (PyUnicode_READY(digits))
|
||||
return -1;
|
||||
pdigits = PyUnicode_DATA(digits);
|
||||
if (PyUnicode_KIND(digits) < kind) {
|
||||
pdigits = _PyUnicode_AsKind(digits, kind);
|
||||
if (pdigits == NULL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue