Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tests/sugar/tree.py
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-12-27 22:40:02 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-12-27 22:40:02 (GMT)
commitd4bc54b120a0885f991c7dadcb168f0fcd5243c2 (patch)
tree61d59531442715b234958e6f7f2a3e9f02a19694 /tests/sugar/tree.py
parent8c6e6552cc4098dedfba8c48e2b01278e984fa7c (diff)
Try to handle atspi ipc errors
Diffstat (limited to 'tests/sugar/tree.py')
-rw-r--r--tests/sugar/tree.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/sugar/tree.py b/tests/sugar/tree.py
index 19206e2..0280d7d 100644
--- a/tests/sugar/tree.py
+++ b/tests/sugar/tree.py
@@ -2,6 +2,7 @@ import logging
import time
from gi.repository import Atspi
+from gi.repository import GLib
Atspi.set_timeout(-1, -1)
@@ -21,7 +22,16 @@ def _retry_find(func):
kwargs.get("name", None),
kwargs.get("role_name", None)))
- result = func(*args, **kwargs)
+ try:
+ result = func(*args, **kwargs)
+ except GLib.GError, e:
+ # The application is not responding, try again
+ if e.code == Atspi.Error.IPC:
+ continue
+
+ logging.error("GError code %d", e.code)
+ raise
+
expect_none = kwargs.get("expect_none", False)
if (not expect_none and result) or \
(expect_none and not result):