diff options
Diffstat (limited to 'Objects/floatobject.c')
-rw-r--r-- | Objects/floatobject.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c index 2de5535..12d4905 100644 --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -182,8 +182,12 @@ PyFloat_FromString(PyObject *v, char **pend) static void float_dealloc(PyFloatObject *op) { - op->ob_type = (struct _typeobject *)free_list; - free_list = op; + if (PyFloat_CheckExact(op)) { + op->ob_type = (struct _typeobject *)free_list; + free_list = op; + } + else + op->ob_type->tp_free((PyObject *)op); } double |