From 1181a7e516fae210c2e446a8f162018f05b95579 Mon Sep 17 00:00:00 2001 From: wirawan Date: Wed, 7 Sep 2011 15:04:15 +0000 Subject: [PATCH] * Add descriptive error message. --- py/im_weakref.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py/im_weakref.py b/py/im_weakref.py index 1230f6e..d0bae80 100644 --- a/py/im_weakref.py +++ b/py/im_weakref.py @@ -1,6 +1,6 @@ # -*- python -*- # -# $Id: im_weakref.py,v 1.1 2011-06-08 15:50:07 wirawan Exp $ +# $Id: im_weakref.py,v 1.2 2011-09-07 15:04:15 wirawan Exp $ # # wpylib.py.im_weakref # Created: 20110607 @@ -54,7 +54,7 @@ class im_ref(object): @raise ReferenceError: When the weak reference refers to a dead object ''' if self.inst is not None and self.inst() is None: - raise ReferenceError + raise ReferenceError, "Original object (of type %s) is already dead." % (self.klass) elif self.inst is not None: # build a new instance method with a strong reference to the instance mtd = new.instancemethod(self.func, self.inst(), self.klass)