From 62b0c2bb65b782ec4d5cdc69aa8090286c08ace7 Mon Sep 17 00:00:00 2001 From: parente Date: Fri, 4 May 2007 17:48:24 +0000 Subject: [PATCH] * pyatspi/accessible.py: Fixed bug #435895, __getitem__ git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@917 e2bd861d-eb25-0410-b326-f6ed22b6b98c --- pyatspi/ChangeLog | 5 +++++ pyatspi/accessible.py | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/pyatspi/ChangeLog b/pyatspi/ChangeLog index 6e909e0..5cf6c0e 100644 --- a/pyatspi/ChangeLog +++ b/pyatspi/ChangeLog @@ -1,6 +1,11 @@ 2007-05-04 Peter Parente * accessible.py: + Fixed bug #435895, Fix __getitem__ + +2007-05-04 Peter Parente + + * accessible.py: Fixed bug #435832, Catch CORBA errors for ORBit.Methods 2007-05-04 Peter Parente diff --git a/pyatspi/accessible.py b/pyatspi/accessible.py index 6ce5dbb..aef89e1 100644 --- a/pyatspi/accessible.py +++ b/pyatspi/accessible.py @@ -415,6 +415,13 @@ class _AccessibleMixin(object): @return: Accessible child @rtype: Accessibility.Accessible ''' + n = self.childCount + if index >= n: + raise IndexError + elif index < -n: + raise IndexError: + elif index < 0: + index += n return self.getChildAtIndex(index) def __len__(self): -- 2.7.4