summaryrefslogtreecommitdiffstats
path: root/Objects/floatobject.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 /Objects/floatobject.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 'Objects/floatobject.c')
-rw-r--r--Objects/floatobject.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index d641311..9c23157 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -1990,20 +1990,10 @@ _PyFloat_InitState(PyInterpreterState *interp)
PyStatus
_PyFloat_InitTypes(PyInterpreterState *interp)
{
- if (!_Py_IsMainInterpreter(interp)) {
- return _PyStatus_OK();
- }
-
- if (PyType_Ready(&PyFloat_Type) < 0) {
- return _PyStatus_ERR("Can't initialize float type");
- }
-
/* Init float info */
- if (FloatInfoType.tp_name == NULL) {
- if (_PyStructSequence_InitBuiltin(&FloatInfoType,
- &floatinfo_desc) < 0) {
- return _PyStatus_ERR("can't init float info type");
- }
+ if (_PyStructSequence_InitBuiltin(&FloatInfoType,
+ &floatinfo_desc) < 0) {
+ return _PyStatus_ERR("can't init float info type");
}
return _PyStatus_OK();