From 7a93328834c6fc74791aa54be9e4d6851c79ea5f Mon Sep 17 00:00:00 2001 From: Hood Date: Sat, 13 Nov 2021 14:10:54 -0800 Subject: [PATCH] Fix _get_pushes_fd and _get_pulls_fd method signatures Getters are supposed to have signature "PyObject *(PyObject *self, void *closure)", but the closure argument is often not used. In wasm it causes a trap if a function is declared with one argument and then called with two. --- src/decode.c | 2 +- src/encode.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/decode.c b/src/decode.c index 91bfabf34..cb018a4e7 100644 --- a/src/decode.c +++ b/src/decode.c @@ -235,7 +235,7 @@ _setfd(ImagingDecoderObject *decoder, PyObject *args) { } static PyObject * -_get_pulls_fd(ImagingDecoderObject *decoder) { +_get_pulls_fd(ImagingDecoderObject *decoder, void *closure) { return PyBool_FromLong(decoder->pulls_fd); } diff --git a/src/encode.c b/src/encode.c index 5933e79a5..2ecf9723b 100644 --- a/src/encode.c +++ b/src/encode.c @@ -299,7 +299,7 @@ _setfd(ImagingEncoderObject *encoder, PyObject *args) { } static PyObject * -_get_pushes_fd(ImagingEncoderObject *encoder) { +_get_pushes_fd(ImagingEncoderObject *encoder, void *closure) { return PyBool_FromLong(encoder->pushes_fd); }