summaryrefslogtreecommitdiffstats
path: root/Modules/_struct.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_struct.c')
-rw-r--r--Modules/_struct.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/_struct.c b/Modules/_struct.c
index 43be9ed..4a257c0 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -1567,11 +1567,11 @@ s_unpack(PyObject *self, PyObject *input)
PyErr_Format(StructError,
"unpack requires a bytes argument of length %zd",
soself->s_size);
- PyObject_ReleaseBuffer(input, &vbuf);
+ PyBuffer_Release(&vbuf);
return NULL;
}
result = s_unpack_internal(soself, vbuf.buf);
- PyObject_ReleaseBuffer(input, &vbuf);
+ PyBuffer_Release(&vbuf);
return result;
}
@@ -1609,11 +1609,11 @@ s_unpack_from(PyObject *self, PyObject *args, PyObject *kwds)
PyErr_Format(StructError,
"unpack_from requires a buffer of at least %zd bytes",
soself->s_size);
- PyObject_ReleaseBuffer(input, &vbuf);
+ PyBuffer_Release(&vbuf);
return NULL;
}
result = s_unpack_internal(soself, (char*)vbuf.buf + offset);
- PyObject_ReleaseBuffer(input, &vbuf);
+ PyBuffer_Release(&vbuf);
return result;
}