Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-87347: Fix PyObject_NEW() regression #94234

Merged
merged 1 commit into from
Jun 26, 2022
Merged

gh-87347: Fix PyObject_NEW() regression #94234

merged 1 commit into from
Jun 26, 2022

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Jun 24, 2022

Don't add parenthesis around the type parameter.

Add unit tests on PyObject_NEW() and similar functions.

@vstinner
Copy link
Member Author

cc @corona10

Copy link
Member

@corona10 corona10 left a comment

Choose a reason for hiding this comment

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

lgtm!

static PyObject *
test_pymem_new(PyObject *self, PyObject *Py_UNUSED(ignored))
{
#define CHECK_PTR(ptr) \
Copy link
Contributor

Choose a reason for hiding this comment

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

Unused macro?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like leftovers from an early revision. I'm sure Victor will remove it before merging.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, I forgot about it. That's why reviews are great :-) I removed this unused macro. I used if+goto instead of the macro.

Don't add parenthesis around the type parameter.

Add unit tests on PyObject_NEW() and similar functions.
@vstinner vstinner merged commit 44c8e68 into python:main Jun 26, 2022
@vstinner vstinner deleted the object_new branch June 26, 2022 10:40
@vstinner
Copy link
Member Author

Merged, thanks for reviews!

@vstinner
Copy link
Member Author

Oops, my test leaks 4 references: I wrote PR #94330 to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants