@@ -170,10 +170,11 @@ image_resample(PyObject *self, PyObject* args, PyObject *kwargs)
170
170
}
171
171
172
172
py_is_affine2 = PyObject_IsTrue (py_is_affine);
173
+ Py_DECREF (py_is_affine);
173
174
174
175
if (py_is_affine2 == -1 ) {
175
176
goto error;
176
- } else if (py_is_affine2 == 1 ) {
177
+ } else if (py_is_affine2) {
177
178
if (!convert_trans_affine (py_transform, ¶ms.affine )) {
178
179
goto error;
179
180
}
@@ -190,8 +191,10 @@ image_resample(PyObject *self, PyObject* args, PyObject *kwargs)
190
191
}
191
192
192
193
if (PyArray_NDIM (input_array) != PyArray_NDIM (output_array)) {
193
- PyErr_Format (PyExc_ValueError, " Mismatched number of dimensions. Got %d and %d." ,
194
- PyArray_NDIM (input_array), PyArray_NDIM (output_array));
194
+ PyErr_Format (
195
+ PyExc_ValueError,
196
+ " Mismatched number of dimensions. Got %d and %d." ,
197
+ PyArray_NDIM (input_array), PyArray_NDIM (output_array));
195
198
goto error;
196
199
}
197
200
@@ -202,8 +205,9 @@ image_resample(PyObject *self, PyObject* args, PyObject *kwargs)
202
205
203
206
if (PyArray_NDIM (input_array) == 3 ) {
204
207
if (PyArray_DIM (output_array, 2 ) != 4 ) {
205
- PyErr_SetString (PyExc_ValueError,
206
- " Output array must be RGBA" );
208
+ PyErr_SetString (
209
+ PyExc_ValueError,
210
+ " Output array must be RGBA" );
207
211
goto error;
208
212
}
209
213
0 commit comments