gh-132775: Add _PyMarshal_GetXIData() (gh-133108)

Note that the bulk of this change is tests.
This commit is contained in:
Eric Snow 2025-04-28 17:23:46 -06:00 committed by GitHub
parent 68a737691b
commit bdd23c0bb9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 337 additions and 10 deletions

View file

@ -1730,6 +1730,11 @@ get_crossinterp_data(PyObject *self, PyObject *args, PyObject *kwargs)
goto error;
}
}
else if (strcmp(mode, "marshal") == 0) {
if (_PyMarshal_GetXIData(tstate, obj, xidata) != 0) {
goto error;
}
}
else {
PyErr_Format(PyExc_ValueError, "unsupported mode %R", modeobj);
goto error;