use PyErr_SetString instead of PyErr_Format
This commit is contained in:
parent
318b8f35fe
commit
23b628ed0b
|
@ -326,7 +326,7 @@ type_abstractmethods(PyTypeObject *type, void *context)
|
||||||
if (type != &PyType_Type)
|
if (type != &PyType_Type)
|
||||||
mod = PyDict_GetItemString(type->tp_dict, "__abstractmethods__");
|
mod = PyDict_GetItemString(type->tp_dict, "__abstractmethods__");
|
||||||
if (!mod) {
|
if (!mod) {
|
||||||
PyErr_Format(PyExc_AttributeError, "__abstractmethods__");
|
PyErr_SetString(PyExc_AttributeError, "__abstractmethods__");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
Py_XINCREF(mod);
|
Py_XINCREF(mod);
|
||||||
|
@ -347,7 +347,7 @@ type_set_abstractmethods(PyTypeObject *type, PyObject *value, void *context)
|
||||||
else {
|
else {
|
||||||
res = PyDict_DelItemString(type->tp_dict, "__abstractmethods__");
|
res = PyDict_DelItemString(type->tp_dict, "__abstractmethods__");
|
||||||
if (res && PyErr_ExceptionMatches(PyExc_KeyError)) {
|
if (res && PyErr_ExceptionMatches(PyExc_KeyError)) {
|
||||||
PyErr_Format(PyExc_AttributeError, "__abstractmethods__", value);
|
PyErr_SetString(PyExc_AttributeError, "__abstractmethods__");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue