Skip to content

Commit

Permalink
rename PyCapsule -> Capsule
Browse files Browse the repository at this point in the history
  • Loading branch information
homm committed Sep 3, 2024
1 parent 147f75e commit 4eb58da
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 27 deletions.
4 changes: 1 addition & 3 deletions src/Tk/tkImaging.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ ImagingFind(const char *name) {
}

if (!PyCapsule_IsValid(capsule, IMAGING_MAGIC)) {
PyErr_Format(
PyExc_TypeError, "Expected PyCapsule with '%s' name.", IMAGING_MAGIC
);
PyErr_Format(PyExc_TypeError, "Expected '%s' Capsule", IMAGING_MAGIC);
return NULL;
}

Expand Down
4 changes: 1 addition & 3 deletions src/_imagingcms.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,9 +541,7 @@ cms_transform_apply(CmsTransformObject *self, PyObject *args) {

if (!PyCapsule_IsValid(i0, IMAGING_MAGIC) ||
!PyCapsule_IsValid(i1, IMAGING_MAGIC)) {
PyErr_Format(
PyExc_TypeError, "Expected PyCapsule with '%s' name.", IMAGING_MAGIC
);
PyErr_Format(PyExc_TypeError, "Expected '%s' Capsule", IMAGING_MAGIC);
return NULL;
}

Expand Down
16 changes: 4 additions & 12 deletions src/_imagingmath.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,12 @@ _unop(PyObject *self, PyObject *args) {
}

if (!PyCapsule_IsValid(op, MATH_FUNC_UNOP_MAGIC)) {
PyErr_Format(
PyExc_TypeError, "Expected PyCapsule with '%s' name.", MATH_FUNC_UNOP_MAGIC
);
PyErr_Format(PyExc_TypeError, "Expected '%s' Capsule", MATH_FUNC_UNOP_MAGIC);
return NULL;
}
if (!PyCapsule_IsValid(i0, IMAGING_MAGIC) ||
!PyCapsule_IsValid(i1, IMAGING_MAGIC)) {
PyErr_Format(
PyExc_TypeError, "Expected PyCapsule with '%s' name.", IMAGING_MAGIC
);
PyErr_Format(PyExc_TypeError, "Expected '%s' Capsule", IMAGING_MAGIC);
return NULL;
}

Expand All @@ -213,17 +209,13 @@ _binop(PyObject *self, PyObject *args) {
}

if (!PyCapsule_IsValid(op, MATH_FUNC_BINOP_MAGIC)) {
PyErr_Format(
PyExc_TypeError, "Expected PyCapsule with '%s' name.", MATH_FUNC_BINOP_MAGIC
);
PyErr_Format(PyExc_TypeError, "Expected '%s' Capsule", MATH_FUNC_BINOP_MAGIC);
return NULL;
}
if (!PyCapsule_IsValid(i0, IMAGING_MAGIC) ||
!PyCapsule_IsValid(i1, IMAGING_MAGIC) ||
!PyCapsule_IsValid(i2, IMAGING_MAGIC)) {
PyErr_Format(
PyExc_TypeError, "Expected PyCapsule with '%s' name.", IMAGING_MAGIC
);
PyErr_Format(PyExc_TypeError, "Expected '%s' Capsule", IMAGING_MAGIC);
return NULL;
}

Expand Down
12 changes: 3 additions & 9 deletions src/_imagingmorph.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ apply(PyObject *self, PyObject *args) {

if (!PyCapsule_IsValid(i0, IMAGING_MAGIC) ||
!PyCapsule_IsValid(i1, IMAGING_MAGIC)) {
PyErr_Format(
PyExc_TypeError, "Expected PyCapsule with '%s' name.", IMAGING_MAGIC
);
PyErr_Format(PyExc_TypeError, "Expected '%s' Capsule", IMAGING_MAGIC);
return NULL;
}

Expand Down Expand Up @@ -143,9 +141,7 @@ match(PyObject *self, PyObject *args) {
}

if (!PyCapsule_IsValid(i0, IMAGING_MAGIC)) {
PyErr_Format(
PyExc_TypeError, "Expected PyCapsule with '%s' name.", IMAGING_MAGIC
);
PyErr_Format(PyExc_TypeError, "Expected '%s' Capsule", IMAGING_MAGIC);
return NULL;
}

Expand Down Expand Up @@ -218,9 +214,7 @@ get_on_pixels(PyObject *self, PyObject *args) {
}

if (!PyCapsule_IsValid(i0, IMAGING_MAGIC)) {
PyErr_Format(
PyExc_TypeError, "Expected PyCapsule with '%s' name.", IMAGING_MAGIC
);
PyErr_Format(PyExc_TypeError, "Expected '%s' Capsule", IMAGING_MAGIC);
return NULL;
}

Expand Down

0 comments on commit 4eb58da

Please sign in to comment.