Visitar URL original
gh-140550: Update xxlimited with 3.15 limited API & PEP 697 by encukou · Pull Request #142827 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
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
Next Next commit
Address review comments
  • Loading branch information
encukou committed May 7, 2026
commit f08fac833563f03ec1fd02faafe1396a1e000329
5 changes: 3 additions & 2 deletions Modules/xxlimited.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ xx_modexec(PyObject *m)
return -1;
}
if (PyModule_AddType(m, Str_Type) < 0) {
Py_DECREF(Str_Type);
return -1;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we have to call Py_DECREF(Str_Type) here (on error)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the catch!

}
Py_DECREF(Str_Type);
Expand Down Expand Up @@ -638,7 +639,7 @@ PyABIInfo_VAR(abi_info);
static PySlot xx_slots[] = {
/* Basic metadata */
PySlot_STATIC_DATA(Py_mod_name, "xxlimited"),
PySlot_STATIC_DATA(Py_mod_doc, (void*)module_doc),
PySlot_STATIC_DATA(Py_mod_doc, module_doc),
PySlot_DATA(Py_mod_abi, &abi_info),

/* The method table */
Expand All @@ -650,7 +651,7 @@ static PySlot xx_slots[] = {
PySlot_FUNC(Py_mod_exec, xx_modexec),

/* Module state and associated functions */
PySlot_SIZE(Py_mod_state_size, (void*)sizeof(xx_state)),
PySlot_SIZE(Py_mod_state_size, sizeof(xx_state)),
PySlot_FUNC(Py_mod_state_traverse, xx_traverse),
PySlot_FUNC(Py_mod_state_clear, xx_clear),
PySlot_FUNC(Py_mod_state_free, xx_free),
Expand Down