Not all things callable have an im_self, so harden the test logic against that. getat...
authorEnrico Granata <egranata@apple.com>
Mon, 17 Nov 2014 19:00:20 +0000 (19:00 +0000)
committerEnrico Granata <egranata@apple.com>
Mon, 17 Nov 2014 19:00:20 +0000 (19:00 +0000)
llvm-svn: 222160

lldb/test/lldbtest.py

index 3b1d661..9abc4b5 100644 (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 or hook.im_self:
+            if hook_argc == 0 or getattr(hook,'im_self',None):
                 hook()
             elif hook_argc == 1:
                 hook(self)