diff options
author | Enrico Granata <egranata@apple.com> | 2014-11-17 19:00:20 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2014-11-17 19:00:20 +0000 |
commit | 6e0566c6d9a8e4d385e55af31072f192fa6826d4 (patch) | |
tree | aa4321b252bcc29e4b4ad15265360aa1a2da6409 | |
parent | 85a429a67a59f692dc452e6f1432e3859043f703 (diff) | |
download | bcm5719-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.py | 2 |
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) |