Skip to content

Commit

Permalink
fix errors with mp_length
Browse files Browse the repository at this point in the history
  • Loading branch information
oclyke committed Nov 29, 2023
1 parent 759a88b commit 57c5a7d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/types/color_sequence/type.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ static PyObject* interpolate(

static Py_ssize_t mp_length(PyObject* self_in) {
ColorSequenceObject* self = (ColorSequenceObject*)self_in;
return PyLong_FromLong(self->_sequence.length);
return self->_sequence.length;
}

static PyObject* mp_subscript(PyObject* self_in, PyObject* key) {
Expand Down
2 changes: 1 addition & 1 deletion src/types/scalar_field/type.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static int allocate_scalars(ScalarFieldObject* self, size_t len) {

static Py_ssize_t mp_length(PyObject* self_in) {
ScalarFieldObject* self = (ScalarFieldObject*)self_in;
return PyLong_FromLong(self->length);
return self->length;
}

static PyObject* mp_subscript(PyObject* self_in, PyObject* key) {
Expand Down

0 comments on commit 57c5a7d

Please sign in to comment.