diff options
author | Victor Stinner <vstinner@python.org> | 2022-06-26 10:40:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-26 10:40:17 (GMT) |
commit | 44c8e68b8cae2627ffe54a2ef407af0271981ed3 (patch) | |
tree | 977aed7c3ef385efc4da76899f09678b3f62057f /Include/objimpl.h | |
parent | 17ed560fcd0a1442485f9bd48884bbe412f35abc (diff) | |
download | cpython-44c8e68b8cae2627ffe54a2ef407af0271981ed3.zip cpython-44c8e68b8cae2627ffe54a2ef407af0271981ed3.tar.gz cpython-44c8e68b8cae2627ffe54a2ef407af0271981ed3.tar.bz2 |
gh-87347: Fix PyObject_NEW() regression (#94234)
Don't add parenthesis around the type parameter.
Add unit tests on PyObject_NEW() and similar functions.
Diffstat (limited to 'Include/objimpl.h')
-rw-r--r-- | Include/objimpl.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Include/objimpl.h b/Include/objimpl.h index 1409181..dde8df3 100644 --- a/Include/objimpl.h +++ b/Include/objimpl.h @@ -135,14 +135,14 @@ PyAPI_FUNC(PyVarObject *) _PyObject_NewVar(PyTypeObject *, Py_ssize_t); // Alias to PyObject_New(). In Python 3.8, PyObject_NEW() called directly // PyObject_MALLOC() with _PyObject_SIZE(). -#define PyObject_NEW(type, typeobj) PyObject_New((type), (typeobj)) +#define PyObject_NEW(type, typeobj) PyObject_New(type, (typeobj)) #define PyObject_NewVar(type, typeobj, n) \ ( (type *) _PyObject_NewVar((typeobj), (n)) ) // Alias to PyObject_NewVar(). In Python 3.8, PyObject_NEW_VAR() called // directly PyObject_MALLOC() with _PyObject_VAR_SIZE(). -#define PyObject_NEW_VAR(type, typeobj, n) PyObject_NewVar((type), (typeobj), (n)) +#define PyObject_NEW_VAR(type, typeobj, n) PyObject_NewVar(type, (typeobj), (n)) /* |