diff options
author | Bastien Nocera <hadess@hadess.net> | 2022-02-23 16:01:39 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2022-02-23 16:02:32 +0100 |
commit | 49799919f1078d1bb1d8bddede552e9f1806c321 (patch) | |
tree | 21b426bdb770c3e15585d9adbb6e2385e1fb7f55 /tests | |
parent | 2a2e4a58ad6edd6b3a8c84b99274d7f90a8a2cd8 (diff) | |
download | gnome-bluetooth-49799919f1078d1bb1d8bddede552e9f1806c321.tar.gz |
tests: Fix wait_for_condition() again
UnboundLocalError: local variable 'timeout' referenced before assignment
Fixes: 9fb72c027f9119e6992771e4ce1f0a33c80d3e7c
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/integration-test.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/integration-test.py b/tests/integration-test.py index 4ec7f82f..3fa5f703 100755 --- a/tests/integration-test.py +++ b/tests/integration-test.py @@ -79,13 +79,12 @@ class OopTests(dbusmock.DBusTestCase): def wait_for_condition(self, condition, timeout=5): ctx = GLib.main_context_default() - timeout = timeout * 1000 + remaining = timeout * 1000 interval = 100 timed_out = False def timeout_cb(): - nonlocal timed_out - nonlocal interval - timeout = timeout - interval + nonlocal timed_out, interval, timeout + remaining = remaining - interval if timeout <= 0: timed_out = True return False |