Replace a few places where X->ob_type was compared to &PyXXX_Type with

calls to PyXXX_CheckExact(X).
This commit is contained in:
Guido van Rossum 2001-09-11 16:13:52 +00:00
parent ae01046f7b
commit dea6ef9bfd
2 changed files with 7 additions and 7 deletions

View file

@ -775,7 +775,7 @@ PyFloat_Fini(void)
for (i = 0, p = &list->objects[0];
i < N_FLOATOBJECTS;
i++, p++) {
if (p->ob_type == &PyFloat_Type && p->ob_refcnt != 0)
if (PyFloat_CheckExact(p) && p->ob_refcnt != 0)
frem++;
}
next = list->next;
@ -785,7 +785,7 @@ PyFloat_Fini(void)
for (i = 0, p = &list->objects[0];
i < N_FLOATOBJECTS;
i++, p++) {
if (p->ob_type != &PyFloat_Type ||
if (!PyFloat_CheckExact(p) ||
p->ob_refcnt == 0) {
p->ob_type = (struct _typeobject *)
free_list;
@ -818,7 +818,7 @@ PyFloat_Fini(void)
for (i = 0, p = &list->objects[0];
i < N_FLOATOBJECTS;
i++, p++) {
if (p->ob_type == &PyFloat_Type &&
if (PyFloat_CheckExact(p) &&
p->ob_refcnt != 0) {
char buf[100];
PyFloat_AsString(buf, p);