Skip to content

Commit 8e332eb

Browse files
hommradarhere
authored andcommitted
Apply suggestions from code review
Co-authored-by: Andrew Murray <[email protected]>
1 parent b9d1768 commit 8e332eb

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

Tests/test_image_getim.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ def test_sanity() -> None:
1616

1717
with pytest.warns(DeprecationWarning):
1818
ptrs = dict(im.im.unsafe_ptrs)
19-
assert all(k in ptrs for k in ["image8", "image32", "image"])
19+
assert ptrs.keys() == {"image8", "image32", "image"}

src/_imaging.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3706,7 +3706,7 @@ static PyObject *
37063706
_getattr_id(ImagingObject *self, void *closure) {
37073707
if (PyErr_WarnEx(
37083708
PyExc_DeprecationWarning,
3709-
"id property is deprecated and will be removed in Pillow 12.0",
3709+
"id property is deprecated and will be removed in Pillow 12 (2025-10-15)",
37103710
1
37113711
) < 0) {
37123712
return NULL;
@@ -3732,7 +3732,8 @@ static PyObject *
37323732
_getattr_unsafe_ptrs(ImagingObject *self, void *closure) {
37333733
if (PyErr_WarnEx(
37343734
PyExc_DeprecationWarning,
3735-
"unsafe_ptrs property is deprecated and will be removed in Pillow 12.0",
3735+
"unsafe_ptrs property is deprecated and will be removed in Pillow 12 "
3736+
"(2025-10-15)",
37363737
1
37373738
) < 0) {
37383739
return NULL;

src/_imagingmorph.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
static PyObject *
3030
apply(PyObject *self, PyObject *args) {
3131
const char *lut;
32-
PyObject *i0, *i1;
3332
Py_ssize_t lut_len;
33+
PyObject *i0, *i1;
3434
Imaging imgin, imgout;
3535
int width, height;
3636
int row_idx, col_idx;
@@ -124,8 +124,8 @@ apply(PyObject *self, PyObject *args) {
124124
static PyObject *
125125
match(PyObject *self, PyObject *args) {
126126
const char *lut;
127-
PyObject *i0;
128127
Py_ssize_t lut_len;
128+
PyObject *i0;
129129
Imaging imgin;
130130
int width, height;
131131
int row_idx, col_idx;

src/libImaging/Imaging.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ typedef struct ImagingHistogramInstance *ImagingHistogram;
6060
typedef struct ImagingOutlineInstance *ImagingOutline;
6161
typedef struct ImagingPaletteInstance *ImagingPalette;
6262

63-
/* handle magics (used with PyCObject). */
63+
/* handle magics (used with PyCapsule). */
6464
#define IMAGING_MAGIC "Pillow Imaging"
6565

6666
/* pixel types */

0 commit comments

Comments
 (0)