Fix: Object cache was removing objects properly.

Continue to update test to use unittest.
This commit is contained in:
Siu Kwan Lam 2012-07-21 15:57:39 -07:00
commit badac267cc
2 changed files with 84 additions and 84 deletions

View file

@ -128,8 +128,9 @@ class _ObjectCache(type):
@staticmethod
def forget(obj):
objid = _core.PyCObjectVoidPtrToPyLong(obj.ptr)
if objid in _ObjectCache.__instances:
del _ObjectCache.__instances[objid]
key = "%s:%d" % (type(obj).__name__, objid)
if key in _ObjectCache.__instances:
del _ObjectCache.__instances[key]
#===----------------------------------------------------------------------===