forked from OSchip/llvm-project
Not all things callable have an im_self, so harden the test logic against that. getattr(,,None) is the closest to ?. we have in Python, so use that
llvm-svn: 222160
This commit is contained in:
parent
85a429a67a
commit
6e0566c6d9
|
@ -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 or hook.im_self:
|
||||
if hook_argc == 0 or getattr(hook,'im_self',None):
|
||||
hook()
|
||||
elif hook_argc == 1:
|
||||
hook(self)
|
||||
|
|
Loading…
Reference in New Issue