diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2013-01-09 23:19:13 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2013-01-09 23:19:13 (GMT) |
commit | 2defc4cddbd09fd919c8972ab64cc498d8ac260a (patch) | |
tree | 59d3bd9eddfdef8c5eda31afd85c1ffef38af179 /tests/sugar/tree.py | |
parent | 13bf9a240e418529fc683f8c53b681fe0575a005 (diff) |
root_accessible might be None too
Diffstat (limited to 'tests/sugar/tree.py')
-rw-r--r-- | tests/sugar/tree.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/sugar/tree.py b/tests/sugar/tree.py index 6607371..9a81f11 100644 --- a/tests/sugar/tree.py +++ b/tests/sugar/tree.py @@ -8,15 +8,15 @@ Atspi.set_timeout(-1, -1) def get_root(wait=True): - desktop = Node(Atspi.get_desktop(0)) - - if not wait: - return desktop - n_tries = 0 - while n_tries < 50: - if desktop.get_children(): - return desktop + while n_tries < 5: + root_accessible = Atspi.get_desktop(0) + if root_accessible: + desktop = Node(root_accessible) + if desktop.get_children(): + return desktop + elif not wait: + return None n_tries = n_tries + 1 logging.info("Waiting for a valid accessibility tree %d" % n_tries) |