summaryrefslogtreecommitdiffstats
path: root/Modules/mathmodule.c
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2023-04-27 22:19:43 (GMT)
committerGitHub <noreply@github.com>2023-04-27 22:19:43 (GMT)
commitd2e2e53f733f8c8098035bbbc452bd1892796cb3 (patch)
tree4f01c11ff1f6ad9ebbcd4786bca991878226a4c6 /Modules/mathmodule.c
parent56c7176d1de3a0770085cad3865c1de42ba86f42 (diff)
downloadcpython-d2e2e53f733f8c8098035bbbc452bd1892796cb3.zip
cpython-d2e2e53f733f8c8098035bbbc452bd1892796cb3.tar.gz
cpython-d2e2e53f733f8c8098035bbbc452bd1892796cb3.tar.bz2
gh-94673: Ensure Builtin Static Types are Readied Properly (gh-103940)
There were cases where we do unnecessary work for builtin static types. This also simplifies some work necessary for a per-interpreter GIL.
Diffstat (limited to 'Modules/mathmodule.c')
-rw-r--r--Modules/mathmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index eddc1a3..a5e82d5 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -2096,7 +2096,7 @@ math_trunc(PyObject *module, PyObject *x)
return PyFloat_Type.tp_as_number->nb_int(x);
}
- if (Py_TYPE(x)->tp_dict == NULL) {
+ if (_PyType_IsReady(Py_TYPE(x))) {
if (PyType_Ready(Py_TYPE(x)) < 0)
return NULL;
}