summaryrefslogtreecommitdiffstats
path: root/Modules/_struct.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_struct.c')
-rw-r--r--Modules/_struct.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/_struct.c b/Modules/_struct.c
index 078c3a5..30feaa6 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -1755,6 +1755,8 @@ s_pack_into(PyObject *self, PyObject *args)
/* Extract the offset from the first argument */
offset = PyInt_AsSsize_t(PyTuple_GET_ITEM(args, 1));
+ if (offset == -1 && PyErr_Occurred())
+ return NULL;
/* Support negative offsets. */
if (offset < 0)