Skip to content

Commit f77c71e

Browse files
authored
gh-87613: Pass borrowed *args and **kwargs through without Py_INCREF (#162781)
1 parent 352cc06 commit f77c71e

13 files changed

Lines changed: 51 additions & 87 deletions

File tree

‎Lib/test/clinic.test.c‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5205,19 +5205,16 @@ Test___init__(PyObject *self, PyObject *args, PyObject *kwargs)
52055205
!_PyArg_NoKeywords("Test", kwargs)) {
52065206
goto exit;
52075207
}
5208-
__clinic_args = Py_NewRef(args);
5208+
__clinic_args = args;
52095209
return_value = Test___init___impl((TestObj *)self, __clinic_args);
52105210

52115211
exit:
5212-
/* Cleanup for args */
5213-
Py_XDECREF(__clinic_args);
5214-
52155212
return return_value;
52165213
}
52175214

52185215
static int
52195216
Test___init___impl(TestObj *self, PyObject *args)
5220-
/*[clinic end generated code: output=0e5836c40dbc2397 input=a615a4485c0fc3e2]*/
5217+
/*[clinic end generated code: output=9bc0cdebce4c710f input=a615a4485c0fc3e2]*/
52215218

52225219
/*[clinic input]
52235220
@vectorcall

‎Modules/clinic/_csv.c.h‎

Lines changed: 5 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Modules/clinic/_elementtree.c.h‎

Lines changed: 2 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Modules/clinic/_interpretersmodule.c.h‎

Lines changed: 2 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Modules/clinic/_testclinic.c.h‎

Lines changed: 2 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Modules/clinic/_testclinic_kwds.c.h‎

Lines changed: 7 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Modules/clinic/_zoneinfo.c.h‎

Lines changed: 2 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Modules/clinic/atexitmodule.c.h‎

Lines changed: 2 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Objects/clinic/namespaceobject.c.h‎

Lines changed: 2 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Objects/clinic/structseq.c.h‎

Lines changed: 2 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)