mirror of
https://github.com/python/cpython.git
synced 2025-07-22 18:55:22 +00:00
Check error when calling PyUnicode_AppendAndDel()
This commit is contained in:
parent
1a15aba71d
commit
67002af323
2 changed files with 7 additions and 5 deletions
|
@ -944,9 +944,9 @@ void _ctypes_extend_error(PyObject *exc_class, char *fmt, ...)
|
||||||
else {
|
else {
|
||||||
PyErr_Clear();
|
PyErr_Clear();
|
||||||
PyUnicode_AppendAndDel(&s, PyUnicode_FromString("???"));
|
PyUnicode_AppendAndDel(&s, PyUnicode_FromString("???"));
|
||||||
|
}
|
||||||
if (s == NULL)
|
if (s == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
|
||||||
PyErr_SetObject(exc_class, s);
|
PyErr_SetObject(exc_class, s);
|
||||||
error:
|
error:
|
||||||
Py_XDECREF(tp);
|
Py_XDECREF(tp);
|
||||||
|
|
|
@ -248,8 +248,10 @@ dl_funcptr _PyImport_GetDynLoadWindows(const char *shortname,
|
||||||
theInfo,
|
theInfo,
|
||||||
theLength));
|
theLength));
|
||||||
}
|
}
|
||||||
|
if (message != NULL) {
|
||||||
PyErr_SetObject(PyExc_ImportError, message);
|
PyErr_SetObject(PyExc_ImportError, message);
|
||||||
Py_XDECREF(message);
|
Py_DECREF(message);
|
||||||
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue