mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
Move PyErr_NoMemory() closer to the failure.
This commit is contained in:
parent
a0fd1f5a18
commit
2fdf4e7b9b
1 changed files with 1 additions and 1 deletions
|
@ -3108,6 +3108,7 @@ dec_strdup(const char *src, Py_ssize_t size)
|
|||
{
|
||||
char *dest = PyMem_Malloc(size+1);
|
||||
if (dest == NULL) {
|
||||
PyErr_NoMemory();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -3186,7 +3187,6 @@ dec_format(PyObject *dec, PyObject *args)
|
|||
replace_fillchar = 1;
|
||||
fmt = dec_strdup(fmt, size);
|
||||
if (fmt == NULL) {
|
||||
PyErr_NoMemory();
|
||||
return NULL;
|
||||
}
|
||||
fmt[0] = '_';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue