mirror of https://github.com/python/cpython
Fix PyUnicode_Format(): return NULL if PyUnicode_READY(uformat) failed
This error cannot occur in practice: PyUnicode_FromObject() always return a "ready" string.
This commit is contained in:
parent
eb0314f5a8
commit
1929407406
|
@ -13442,8 +13442,10 @@ PyUnicode_Format(PyObject *format, PyObject *args)
|
|||
uformat = PyUnicode_FromObject(format);
|
||||
if (uformat == NULL)
|
||||
return NULL;
|
||||
if (PyUnicode_READY(uformat) == -1)
|
||||
if (PyUnicode_READY(uformat) == -1) {
|
||||
Py_DECREF(uformat);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fmt = PyUnicode_DATA(uformat);
|
||||
fmtkind = PyUnicode_KIND(uformat);
|
||||
|
|
Loading…
Reference in New Issue