Visitar URL original
gh-78724: raise RuntimeError's when calling methods on non-ready Struct()'s by skirpichev · Pull Request #143643 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
address review: revert unrelated change
  • Loading branch information
skirpichev committed Jan 11, 2026
commit b61bddb41b82322ed3de8b4636c41312c5bbb8b5
8 changes: 4 additions & 4 deletions Modules/_struct.c
Original file line number Diff line number Diff line change
Expand Up @@ -1794,6 +1794,8 @@ static int
Struct___init___impl(PyStructObject *self, PyObject *format)
/*[clinic end generated code: output=b8e80862444e92d0 input=192a4575a3dde802]*/
{
int ret = 0;

if (PyUnicode_Check(format)) {
format = PyUnicode_AsASCIIString(format);
if (format == NULL)
Expand All @@ -1814,10 +1816,8 @@ Struct___init___impl(PyStructObject *self, PyObject *format)

Py_SETREF(self->s_format, format);

if (prepare_s(self)) {
return -1;
}
return 0;
ret = prepare_s(self);
return ret;
}

static int
Expand Down
Loading