[Python-checkins] [3.12] gh-94673: Ensure subtypes are readied only once in math.trunc() (gh-105465) (gh-105471)

ericsnowcurrently webhook-mailer at python.org
Wed Jun 7 16:11:17 EDT 2023


https://github.com/python/cpython/commit/1e128779befad65ec8208e0ef0d0688ef8a7f5d2
commit: 1e128779befad65ec8208e0ef0d0688ef8a7f5d2
branch: 3.12
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: ericsnowcurrently <ericsnowcurrently at gmail.com>
date: 2023-06-07T20:11:10Z
summary:

[3.12] gh-94673: Ensure subtypes are readied only once in math.trunc() (gh-105465) (gh-105471)

Fixes a typo in d2e2e53.
(cherry picked from commit 5394bf92aa6516feb3322d8372d1579bd9c1417b)

Co-authored-by: neonene <53406459+neonene at users.noreply.github.com>

files:
M Modules/mathmodule.c

diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index f26602d5871a..f5679fe3a6f3 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -2067,7 +2067,7 @@ math_trunc(PyObject *module, PyObject *x)
         return PyFloat_Type.tp_as_number->nb_int(x);
     }
 
-    if (_PyType_IsReady(Py_TYPE(x))) {
+    if (!_PyType_IsReady(Py_TYPE(x))) {
         if (PyType_Ready(Py_TYPE(x)) < 0)
             return NULL;
     }



More information about the Python-checkins mailing list