diff options
author | Victor Stinner <vstinner@python.org> | 2021-04-02 13:28:13 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-02 13:28:13 (GMT) |
commit | 442ad74fc2928b095760eb89aba93c28eab17f9b (patch) | |
tree | 29f784c0860f41cd6d2c16d34e8ced47ebf5e005 /Objects/floatobject.c | |
parent | 58384c6ab01bbc35cc14cdeb716f6c45a3df426b (diff) | |
download | cpython-442ad74fc2928b095760eb89aba93c28eab17f9b.zip cpython-442ad74fc2928b095760eb89aba93c28eab17f9b.tar.gz cpython-442ad74fc2928b095760eb89aba93c28eab17f9b.tar.bz2 |
bpo-43687: Py_Initialize() creates singletons earlier (GH-25147)
Reorganize pycore_interp_init() to initialize singletons before the
the first PyType_Ready() call. Fix an issue when Python is configured
using --without-doc-strings.
Diffstat (limited to 'Objects/floatobject.c')
-rw-r--r-- | Objects/floatobject.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c index 178f7b2..b3c41b1 100644 --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -1968,7 +1968,7 @@ PyTypeObject PyFloat_Type = { .tp_vectorcall = (vectorcallfunc)float_vectorcall, }; -int +void _PyFloat_Init(void) { /* We attempt to determine if this machine is using IEEE @@ -2016,14 +2016,18 @@ _PyFloat_Init(void) double_format = detected_double_format; float_format = detected_float_format; +} +int +_PyFloat_InitTypes(void) +{ /* Init float info */ if (FloatInfoType.tp_name == NULL) { if (PyStructSequence_InitType2(&FloatInfoType, &floatinfo_desc) < 0) { - return 0; + return -1; } } - return 1; + return 0; } void |