commit | f87b85f80853c580b1c8bf78a51b0e9a25f6e1a7 | [log] [tgz] |
---|---|---|
author | Victor Stinner <victor.stinner@gmail.com> | Fri Jun 23 15:11:12 2017 +0200 |
committer | GitHub <noreply@github.com> | Fri Jun 23 15:11:12 2017 +0200 |
tree | 8417421b14db403e4df4b264c4e4ec09e7c1f4b9 | |
parent | a4b091e135ccf345cfafdd8477aef897c5214f82 [diff] |
bpo-21071: struct.Struct.format type is now str (#845)
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 @@ 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 *