summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_struct.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_struct.c b/Modules/_struct.c
index 46e7b40..b4febf7 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -1957,8 +1957,8 @@ s_pack_into(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames
static PyObject *
s_get_format(PyStructObject *self, void *unused)
{
- Py_INCREF(self->s_format);
- return self->s_format;
+ return PyUnicode_FromStringAndSize(PyBytes_AS_STRING(self->s_format),
+ PyBytes_GET_SIZE(self->s_format));
}
static PyObject *