attr_old = getattrs(self->win);
if (curses_wattrset(self, attr, "addstr") < 0) {
curses_release_wstr(strtype, wstr);
+ Py_XDECREF(bytesobj);
return NULL;
}
}
#ifdef HAVE_NCURSESW
if (strtype == 2) {
+ assert(bytesobj == NULL);
if (use_xy) {
rtn = mvwaddwstr(self->win,y,x,wstr);
funcname = "mvwaddwstr";
else
#endif
{
+ assert(wstr == NULL);
const char *str = PyBytes_AS_STRING(bytesobj);
if (use_xy) {
rtn = mvwaddstr(self->win,y,x,str);
attr_old = getattrs(self->win);
if (curses_wattrset(self, attr, "addnstr") < 0) {
curses_release_wstr(strtype, wstr);
+ Py_XDECREF(bytesobj);
return NULL;
}
}
attr_old = getattrs(self->win);
if (curses_wattrset(self, attr, "insstr") < 0) {
curses_release_wstr(strtype, wstr);
+ Py_XDECREF(bytesobj);
return NULL;
}
}
}
unsigned char *bin_data = PyBytesWriter_GetData(writer);
if (bin_data == NULL) {
- return NULL;
+ goto error;
}
uint32_t leftchar = 0;
&PyTuple_GET_ITEM(arg, 0),
PyTuple_GET_SIZE(arg));
if (j < 0) {
+ Py_DECREF(subparams);
+ Py_DECREF(subargs);
return NULL;
}
continue;
if (is_args_list) {
args = tuple_args = PySequence_Tuple(args);
if (args == NULL) {
+ Py_DECREF(item);
return NULL;
}
}
// Augment the exception with the name and object
if (PyObject_SetAttr(exc, &_Py_ID(name), name) ||
PyObject_SetAttr(exc, &_Py_ID(obj), v)) {
+ Py_DECREF(exc);
return 1;
}
restore:
list = PyList_New(0);
if (list == NULL)
return -1;
- if (PyDict_SetItem(dict, &_Py_ID(Py_Repr), list) < 0)
+ if (_PyDict_SetItem_Take2((PyDictObject *)dict, &_Py_ID(Py_Repr), list) < 0) {
return -1;
- Py_DECREF(list);
+ }
}
i = PyList_GET_SIZE(list);
while (--i >= 0) {
}
if (_PyTuple_Resize(&keys, k) == -1) {
- goto error;
+ assert(keys == NULL);
+ return -1;
}
if (PyDict_SetItemString(dict, match_args_key, keys) < 0) {
PyObject *
_Py_subscript_generic(PyThreadState* unused, PyObject *params)
{
- params = unpack_typevartuples(params);
-
PyInterpreterState *interp = _PyInterpreterState_GET();
if (interp->cached_objects.generic_type == NULL) {
PyErr_SetString(PyExc_SystemError, "Cannot find Generic type");
return NULL;
}
+ params = unpack_typevartuples(params);
PyObject *args[2] = {(PyObject *)interp->cached_objects.generic_type, params};
PyObject *result = call_typing_func_object("_GenericAlias", args, 2);
Py_DECREF(params);
}
if (_PyUnicodeWriter_Prepare(writer, end - s, 127) < 0) {
- return -1;
+ goto onError;
}
}
}