From 50b1cba6c255740c685b3bd53d31285c3818c6ac Mon Sep 17 00:00:00 2001 From: Benedikt Johannes Date: Sat, 14 Feb 2026 17:40:13 +0100 Subject: [PATCH 1/6] Slightly improve performance in codegen.c via removing indirectly double check through Py_XDECREF(co); --- Python/codegen.c | 1 - 1 file changed, 1 deletion(-) diff --git a/Python/codegen.c b/Python/codegen.c index 32a03e7212eeab..42fccb07d31dba 100644 --- a/Python/codegen.c +++ b/Python/codegen.c @@ -1422,7 +1422,6 @@ codegen_function_body(compiler *c, stmt_ty s, int is_async, Py_ssize_t funcflags PyCodeObject *co = _PyCompile_OptimizeAndAssemble(c, 1); _PyCompile_ExitScope(c); if (co == NULL) { - Py_XDECREF(co); return ERROR; } int ret = codegen_make_closure(c, LOC(s), co, funcflags); From c2f2def01154ca86d76b9d54564f54429a6e8bdd Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Sat, 14 Feb 2026 16:47:40 +0000 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Core_and_Builtins/2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst b/Misc/NEWS.d/next/Core_and_Builtins/2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst new file mode 100644 index 00000000000000..8f4cac43275e16 --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst @@ -0,0 +1,2 @@ +Slightly improved performance in `codegen.c` via removing an indirect double check through `Py_XDECREF(co);`. +Contributed by Benedikt Johannes. From b6d0f0d0377207afda78ce8057977caba183741c Mon Sep 17 00:00:00 2001 From: Benedikt Johannes Date: Sat, 14 Feb 2026 17:49:28 +0100 Subject: [PATCH 3/6] Update 2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst --- .../2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst b/Misc/NEWS.d/next/Core_and_Builtins/2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst index 8f4cac43275e16..adf62c2696a05a 100644 --- a/Misc/NEWS.d/next/Core_and_Builtins/2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst +++ b/Misc/NEWS.d/next/Core_and_Builtins/2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst @@ -1,2 +1,2 @@ -Slightly improved performance in `codegen.c` via removing an indirect double check through `Py_XDECREF(co);`. -Contributed by Benedikt Johannes. +Slightly improve performance in `codegen.c` via removing an indirect double check through `Py_XDECREF(co);`. +Contributed by Benedikt Johannes. From af9d2beae9a17aed6b77055a30392f8d7dd6caff Mon Sep 17 00:00:00 2001 From: Benedikt Johannes Date: Sat, 14 Feb 2026 17:51:33 +0100 Subject: [PATCH 4/6] Update 2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst --- .../2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst b/Misc/NEWS.d/next/Core_and_Builtins/2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst index adf62c2696a05a..06cbf9ef1ee8ee 100644 --- a/Misc/NEWS.d/next/Core_and_Builtins/2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst +++ b/Misc/NEWS.d/next/Core_and_Builtins/2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst @@ -1,2 +1,3 @@ -Slightly improve performance in `codegen.c` via removing an indirect double check through `Py_XDECREF(co);`. +Slightly improve performance in ``codegen.c`` via removing an indirect double check through ``Py_XDECREF(co);``. Contributed by Benedikt Johannes. + From 1bc7d5538e2b761b520d2e06769845fa18097312 Mon Sep 17 00:00:00 2001 From: Benedikt Johannes Date: Sat, 14 Feb 2026 19:38:07 +0100 Subject: [PATCH 5/6] Update 2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst --- .../2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst b/Misc/NEWS.d/next/Core_and_Builtins/2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst index 06cbf9ef1ee8ee..c0706866f124b2 100644 --- a/Misc/NEWS.d/next/Core_and_Builtins/2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst +++ b/Misc/NEWS.d/next/Core_and_Builtins/2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst @@ -1,3 +1,2 @@ -Slightly improve performance in ``codegen.c`` via removing an indirect double check through ``Py_XDECREF(co);``. +Remove an indirect double check in ``codegen.c`` through ``co == NULL`` and ``Py_XDECREF(co);``. Contributed by Benedikt Johannes. - From 075e53b5404bfc9d57fe30d12cdb29d90f9be3fd Mon Sep 17 00:00:00 2001 From: Benedikt Johannes Date: Sat, 14 Feb 2026 19:54:16 +0100 Subject: [PATCH 6/6] Delete Misc/NEWS.d/next/Core_and_Builtins/2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst --- .../2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 Misc/NEWS.d/next/Core_and_Builtins/2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst b/Misc/NEWS.d/next/Core_and_Builtins/2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst deleted file mode 100644 index c0706866f124b2..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2026-02-14-16-47-39.gh-issue-144822.9TCaGe.rst +++ /dev/null @@ -1,2 +0,0 @@ -Remove an indirect double check in ``codegen.c`` through ``co == NULL`` and ``Py_XDECREF(co);``. -Contributed by Benedikt Johannes.