summaryrefslogtreecommitdiffstats
path: root/Objects/capsule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/capsule.c')
-rw-r--r--Objects/capsule.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/Objects/capsule.c b/Objects/capsule.c
index 599893a..ea20f82 100644
--- a/Objects/capsule.c
+++ b/Objects/capsule.c
@@ -201,7 +201,7 @@ PyCapsule_Import(const char *name, int no_block)
char *name_dup = (char *)PyMem_MALLOC(name_length);
if (!name_dup) {
- return PyErr_NoMemory();
+ return NULL;
}
memcpy(name_dup, name, name_length);
@@ -279,7 +279,7 @@ capsule_repr(PyObject *o)
name = "NULL";
}
- return PyUnicode_FromFormat("<capsule object %s%s%s at %p>",
+ return PyString_FromFormat("<capsule object %s%s%s at %p>",
quote, name, quote, capsule);
}
@@ -298,27 +298,27 @@ Python import mechanism to link to one another.\n\
PyTypeObject PyCapsule_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
- "PyCapsule", /*tp_name*/
- sizeof(PyCapsule), /*tp_basicsize*/
- 0, /*tp_itemsize*/
+ "PyCapsule", /*tp_name*/
+ sizeof(PyCapsule), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
/* methods */
capsule_dealloc, /*tp_dealloc*/
- 0, /*tp_vectorcall_offset*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- 0, /*tp_as_async*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ 0, /*tp_reserved*/
capsule_repr, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- 0, /*tp_flags*/
- PyCapsule_Type__doc__ /*tp_doc*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ 0, /*tp_flags*/
+ PyCapsule_Type__doc__ /*tp_doc*/
};