summaryrefslogtreecommitdiffstats
path: root/Modules/structmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/structmodule.c')
-rw-r--r--Modules/structmodule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/structmodule.c b/Modules/structmodule.c
index df80302..bf871ee 100644
--- a/Modules/structmodule.c
+++ b/Modules/structmodule.c
@@ -1273,7 +1273,8 @@ struct_pack(PyObject *self, PyObject *args)
return NULL;
}
format = PyTuple_GetItem(args, 0);
- if (!PyArg_Parse(format, "s", &fmt))
+ fmt = PyString_AsString(format);
+ if (!fmt)
return NULL;
f = whichtable(&fmt);
size = calcsize(fmt, f);