summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2014-11-17 19:00:20 +0000
committerEnrico Granata <egranata@apple.com>2014-11-17 19:00:20 +0000
commit6e0566c6d9a8e4d385e55af31072f192fa6826d4 (patch)
treeaa4321b252bcc29e4b4ad15265360aa1a2da6409
parent85a429a67a59f692dc452e6f1432e3859043f703 (diff)
downloadbcm5719-llvm-6e0566c6d9a8e4d385e55af31072f192fa6826d4.tar.gz
bcm5719-llvm-6e0566c6d9a8e4d385e55af31072f192fa6826d4.zip
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
-rw-r--r--lldb/test/lldbtest.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/test/lldbtest.py b/lldb/test/lldbtest.py
index 3b1d661f160..9abc4b54c44 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)
OpenPOWER on IntegriCloud