From 0291b103a8e76003edb9766dc243b4595125b6dd Mon Sep 17 00:00:00 2001 From: Daniel Narvaez Date: Thu, 10 Jan 2013 11:08:19 +0000 Subject: Revert "root_accessible might be None too" This reverts commit 2defc4cddbd09fd919c8972ab64cc498d8ac260a. --- (limited to 'tests/sugar/tree.py') diff --git a/tests/sugar/tree.py b/tests/sugar/tree.py index 9a81f11..6607371 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 < 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 + while n_tries < 50: + if desktop.get_children(): + return desktop n_tries = n_tries + 1 logging.info("Waiting for a valid accessibility tree %d" % n_tries) -- cgit v0.9.1