From 1a96ef800bc240ca9f0fb89c41ccf47b667c0f49 Mon Sep 17 00:00:00 2001 From: Filipe Cabecinhas Date: Fri, 11 May 2012 20:39:42 +0000 Subject: Make every Python API __len__() method return a PyIntObject. swig 2.0+ seems to default to using PyLongObjects, but the __len__() method _must_ return a PyIntObject. llvm-svn: 156639 --- lldb/scripts/Python/interface/SBValueList.i | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lldb/scripts/Python/interface/SBValueList.i') diff --git a/lldb/scripts/Python/interface/SBValueList.i b/lldb/scripts/Python/interface/SBValueList.i index 1bc904980ef..a55345030c0 100644 --- a/lldb/scripts/Python/interface/SBValueList.i +++ b/lldb/scripts/Python/interface/SBValueList.i @@ -98,8 +98,8 @@ public: FindValueObjectByUID (lldb::user_id_t uid); %pythoncode %{ def __len__(self): - return self.GetSize() - + return int(self.GetSize()) + def __getitem__(self, key): count = len(self) #------------------------------------------------------------ -- cgit v1.2.3