Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Murray <[email protected]>
  • Loading branch information
2 people authored and Александр Карпинский committed Oct 7, 2024
1 parent b9d1768 commit 8e332eb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Tests/test_image_getim.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ def test_sanity() -> None:

with pytest.warns(DeprecationWarning):
ptrs = dict(im.im.unsafe_ptrs)
assert all(k in ptrs for k in ["image8", "image32", "image"])
assert ptrs.keys() == {"image8", "image32", "image"}
5 changes: 3 additions & 2 deletions src/_imaging.c
Original file line number Diff line number Diff line change
Expand Up @@ -3706,7 +3706,7 @@ static PyObject *
_getattr_id(ImagingObject *self, void *closure) {
if (PyErr_WarnEx(
PyExc_DeprecationWarning,

Check warning on line 3708 in src/_imaging.c

View check run for this annotation

Codecov / codecov/patch

src/_imaging.c#L3708

Added line #L3708 was not covered by tests
"id property is deprecated and will be removed in Pillow 12.0",
"id property is deprecated and will be removed in Pillow 12 (2025-10-15)",
1
) < 0) {
return NULL;
Expand All @@ -3732,7 +3732,8 @@ static PyObject *
_getattr_unsafe_ptrs(ImagingObject *self, void *closure) {
if (PyErr_WarnEx(
PyExc_DeprecationWarning,
"unsafe_ptrs property is deprecated and will be removed in Pillow 12.0",
"unsafe_ptrs property is deprecated and will be removed in Pillow 12 "

Check warning on line 3735 in src/_imaging.c

View check run for this annotation

Codecov / codecov/patch

src/_imaging.c#L3735

Added line #L3735 was not covered by tests
"(2025-10-15)",
1
) < 0) {
return NULL;
Expand Down
4 changes: 2 additions & 2 deletions src/_imagingmorph.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
static PyObject *
apply(PyObject *self, PyObject *args) {
const char *lut;
PyObject *i0, *i1;
Py_ssize_t lut_len;
PyObject *i0, *i1;
Imaging imgin, imgout;
int width, height;
int row_idx, col_idx;
Expand Down Expand Up @@ -124,8 +124,8 @@ apply(PyObject *self, PyObject *args) {
static PyObject *
match(PyObject *self, PyObject *args) {
const char *lut;
PyObject *i0;
Py_ssize_t lut_len;
PyObject *i0;
Imaging imgin;
int width, height;
int row_idx, col_idx;
Expand Down
2 changes: 1 addition & 1 deletion src/libImaging/Imaging.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ typedef struct ImagingHistogramInstance *ImagingHistogram;
typedef struct ImagingOutlineInstance *ImagingOutline;
typedef struct ImagingPaletteInstance *ImagingPalette;

/* handle magics (used with PyCObject). */
/* handle magics (used with PyCapsule). */
#define IMAGING_MAGIC "Pillow Imaging"

/* pixel types */
Expand Down

0 comments on commit 8e332eb

Please sign in to comment.