Skip to content

gh-106033: Get rid of PyDict_GetItem in _PyFunction_FromConstructor - #106044

Merged
serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:_PyFunction_FromConstructor
Jun 29, 2023
Merged

serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:_PyFunction_FromConstructor

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jun 23, 2023 •

Copy link
Copy Markdown
Member
Comment thread Objects/funcobject.c
}

PyFunctionObject *op = PyObject_GC_New(PyFunctionObject, &PyFunction_Type);
if (op == NULL) {

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.

Py_XDECREF(module) before this error return.

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.

Good catch!

@serhiy-storchaka
serhiy-storchaka merged commit 08c08d2 into python:main Jun 29, 2023
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@serhiy-storchaka
serhiy-storchaka deleted the _PyFunction_FromConstructor branch June 29, 2023 09:31
@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 08c08d21b03d949452a77d9ed5e3cf48d6b9804d 3.11

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 29, 2023
…ctor (pythonGH-106044)

(cherry picked from commit 08c08d2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-bot

Copy link
Copy Markdown

GH-106228 is a backport of this pull request to the 3.12 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.12 only security fixes label Jun 29, 2023
@serhiy-storchaka serhiy-storchaka removed the needs backport to 3.11 only security fixes label Jun 29, 2023
serhiy-storchaka added a commit that referenced this pull request Jun 29, 2023
…uctor (GH-106044) (GH-106228)

gh-106033: Get rid of PyDict_GetItem in _PyFunction_FromConstructor (GH-106044)
(cherry picked from commit 08c08d2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@serhiy-storchaka serhiy-storchaka removed their assignment Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

4 participants