]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-94673: Ensure subtypes are readied only once in math.trunc() (gh-105465)
authorneonene <53406459+neonene@users.noreply.github.com>
Wed, 7 Jun 2023 19:46:00 +0000 (04:46 +0900)
committerGitHub <noreply@github.com>
Wed, 7 Jun 2023 19:46:00 +0000 (13:46 -0600)
Fixes a typo in d2e2e53.

Modules/mathmodule.c

index f26602d5871accd4bf68afd9662218be08608ea9..f5679fe3a6f3621da24438f730d231e5b69812c9 100644 (file)
@@ -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;
     }