Apply suggestions from code review

Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
Alexander Karpinsky 2024-10-07 12:51:44 +04:00 committed by Александр Карпинский
parent b9d1768561
commit 8e332eb3b0
4 changed files with 7 additions and 6 deletions

View File

@ -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"}

View File

@ -3706,7 +3706,7 @@ static PyObject *
_getattr_id(ImagingObject *self, void *closure) {
if (PyErr_WarnEx(
PyExc_DeprecationWarning,
"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;
@ -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 "
"(2025-10-15)",
1
) < 0) {
return NULL;

View File

@ -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;
@ -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;

View File

@ -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 */