* pyatspi/accessible.py: Fixed bug #435895, __getitem__
[platform/core/uifw/at-spi2-atk.git] / pyatspi / accessible.py
index 6ce5dbb..aef89e1 100644 (file)
@@ -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):