Fix a problem reported by Ed Maste where the test harness was failing to call bound methods as cleanup hooks

llvm-svn: 221624
This commit is contained in:
Enrico Granata 2014-11-10 19:51:57 +00:00
parent 8e6923b7f2
commit 4c67655b45
1 changed files with 1 additions and 1 deletions

View File

@ -1039,7 +1039,7 @@ class Base(unittest2.TestCase):
print >> sbuf, "Executing tearDown hook:", getsource_if_available(hook)
import inspect
hook_argc = len(inspect.getargspec(hook).args)
if hook_argc == 0:
if hook_argc == 0 or hook.im_self:
hook()
elif hook_argc == 1:
hook(self)