]> granicus.if.org Git - python/commitdiff
gen_del(): Looks like much this was copy/pasted from
authorTim Peters <tim.peters@gmail.com>
Sat, 15 Apr 2006 22:59:10 +0000 (22:59 +0000)
committerTim Peters <tim.peters@gmail.com>
Sat, 15 Apr 2006 22:59:10 +0000 (22:59 +0000)
slot_tp_del(), but while the latter had to cater to types
that don't participate in GC, we know that generators do.
That allows strengthing an assert().

Objects/genobject.c

index a00aa850eb3ad797f2f7f7c28443197563d17e91..15e53dd23bf4acbe5d56019bb78bf8738032138d 100644 (file)
@@ -185,7 +185,7 @@ gen_del(PyObject *self)
                 _Py_NewReference(self);
                 self->ob_refcnt = refcnt;
         }
-        assert(!PyType_IS_GC(self->ob_type) ||
+        assert(PyType_IS_GC(self->ob_type) &&
                _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
 
         /* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so