Skip to content

Commit c815882

Browse files
committed
address review: fix for format
1 parent 58550c0 commit c815882

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/_struct.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1778,11 +1778,11 @@ s_init(PyStructObject *self, PyObject *format)
17781778
Py_INCREF(format);
17791779
}
17801780
if (!PyBytes_Check(format)) {
1781-
Py_DECREF(format);
17821781
PyErr_Format(PyExc_TypeError,
17831782
"Struct() argument 1 must be a str or bytes object, "
17841783
"not %T",
17851784
format);
1785+
Py_DECREF(format);
17861786
return -1;
17871787
}
17881788
Py_SETREF(self->s_format, format);

0 commit comments

Comments
 (0)