From 6e0566c6d9a8e4d385e55af31072f192fa6826d4 Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Mon, 17 Nov 2014 19:00:20 +0000 Subject: [PATCH] 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 --- lldb/test/lldbtest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/test/lldbtest.py b/lldb/test/lldbtest.py index 3b1d661f1605..9abc4b54c440 100644 --- a/lldb/test/lldbtest.py +++ b/lldb/test/lldbtest.py @@ -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)