summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-11-25 13:55:54 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-11-25 13:55:54 (GMT)
commit8d30ad7c8ad5df59be8a65c8f8dab0d13be00dab (patch)
tree65436ba5d34417e9e89804d3b1c2c324edfb2f4e /Objects
parent80767a38c74318acbd6fc4bfe228a1d0c0556221 (diff)
downloadcpython-8d30ad7c8ad5df59be8a65c8f8dab0d13be00dab.zip
cpython-8d30ad7c8ad5df59be8a65c8f8dab0d13be00dab.tar.gz
cpython-8d30ad7c8ad5df59be8a65c8f8dab0d13be00dab.tar.bz2
Issue #24731: Fixed crash on converting objects with special methods
__str__, __trunc__, and __float__ returning instances of subclasses of str, long, and float to subclasses of str, long, and float correspondingly.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/floatobject.c2
-rw-r--r--Objects/longobject.c2
-rw-r--r--Objects/stringobject.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index 1143fab..82f9960 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -1839,7 +1839,7 @@ float_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
tmp = float_new(&PyFloat_Type, args, kwds);
if (tmp == NULL)
return NULL;
- assert(PyFloat_CheckExact(tmp));
+ assert(PyFloat_Check(tmp));
newobj = type->tp_alloc(type, 0);
if (newobj == NULL) {
Py_DECREF(tmp);
diff --git a/Objects/longobject.c b/Objects/longobject.c
index 405be2e..6427f42 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -4068,7 +4068,7 @@ long_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
tmp = (PyLongObject *)long_new(&PyLong_Type, args, kwds);
if (tmp == NULL)
return NULL;
- assert(PyLong_CheckExact(tmp));
+ assert(PyLong_Check(tmp));
n = Py_SIZE(tmp);
if (n < 0)
n = -n;
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index c1e12a7..14c5177 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -3719,7 +3719,7 @@ str_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
tmp = string_new(&PyString_Type, args, kwds);
if (tmp == NULL)
return NULL;
- assert(PyString_CheckExact(tmp));
+ assert(PyString_Check(tmp));
n = PyString_GET_SIZE(tmp);
pnew = type->tp_alloc(type, n);
if (pnew != NULL) {