summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python/python-extensions.swig
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-09-04 18:59:10 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-09-04 18:59:10 +0000
commit24223eb24c74a116e1a3eb704d28e61454719a74 (patch)
treed69085e3630ccec381cb2942cc1f2fe75e9fcd99 /lldb/scripts/Python/python-extensions.swig
parent5559406ae5d21fab0bcd6a07347f4f928d3c7ce8 (diff)
downloadbcm5719-llvm-24223eb24c74a116e1a3eb704d28e61454719a74.tar.gz
bcm5719-llvm-24223eb24c74a116e1a3eb704d28e61454719a74.zip
[Python] Implement truth testing for lldb.value
Python 3 calls __bool__() instead of __len__() and lldb.value only implemented the __len__ method. This adds the __bool__() implementation. Differential revision: https://reviews.llvm.org/D67183 llvm-svn: 370953
Diffstat (limited to 'lldb/scripts/Python/python-extensions.swig')
-rw-r--r--lldb/scripts/Python/python-extensions.swig3
1 files changed, 3 insertions, 0 deletions
diff --git a/lldb/scripts/Python/python-extensions.swig b/lldb/scripts/Python/python-extensions.swig
index 25fec92fbdf..13bb5821cda 100644
--- a/lldb/scripts/Python/python-extensions.swig
+++ b/lldb/scripts/Python/python-extensions.swig
@@ -980,6 +980,9 @@ class value(object):
def __nonzero__(self):
return self.sbvalue.__nonzero__()
+ def __bool__(self):
+ return self.sbvalue.__bool__()
+
def __str__(self):
return self.sbvalue.__str__()
OpenPOWER on IntegriCloud