summaryrefslogtreecommitdiffstats
path: root/Objects/floatobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/floatobject.c')
-rw-r--r--Objects/floatobject.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index 1398fa5..7ee2034 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -1853,7 +1853,7 @@ PyTypeObject PyFloat_Type = {
float_new, /* tp_new */
};
-void
+int
_PyFloat_Init(void)
{
/* We attempt to determine if this machine is using IEEE
@@ -1903,8 +1903,11 @@ _PyFloat_Init(void)
float_format = detected_float_format;
/* Init float info */
- if (FloatInfoType.tp_name == 0)
- PyStructSequence_InitType(&FloatInfoType, &floatinfo_desc);
+ if (FloatInfoType.tp_name == NULL) {
+ if (PyStructSequence_InitType2(&FloatInfoType, &floatinfo_desc) < 0)
+ return 0;
+ }
+ return 1;
}
int