[telepathy-gabble/master] gabbletest.py: exec_test_deferred: no need to catch every D-Bus error in the test disposing block

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Mon Jul 13 07:37:41 PDT 2009


---
 tests/twisted/gabbletest.py |   32 ++++++++++++++------------------
 1 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/tests/twisted/gabbletest.py b/tests/twisted/gabbletest.py
index 87e44d2..05a94f9 100644
--- a/tests/twisted/gabbletest.py
+++ b/tests/twisted/gabbletest.py
@@ -390,27 +390,23 @@ def exec_test_deferred (funs, params, protocol=None, timeout=None,
         traceback.print_exc()
         error = e
 
-    try:
-        if colourer:
-          sys.stdout = colourer.fh
-        d = port.stopListening()
-        if error is None:
-            d.addBoth((lambda *args: reactor.crash()))
-        else:
-            # please ignore the POSIX behind the curtain
-            d.addBoth((lambda *args: os._exit(1)))
-
-        try:
-            conn.Disconnect()
-        except dbus.DBusException, e:
-            # Connection has already been disconnected
-            pass
-        else:
-            queue.expect('dbus-signal', signal='StatusChanged',
-                args=[cs.CONN_STATUS_DISCONNECTED, cs.CSR_REQUESTED])
+    if colourer:
+      sys.stdout = colourer.fh
+    d = port.stopListening()
+    if error is None:
+        d.addBoth((lambda *args: reactor.crash()))
+    else:
+        # please ignore the POSIX behind the curtain
+        d.addBoth((lambda *args: os._exit(1)))
 
+    try:
+        conn.Disconnect()
     except dbus.DBusException, e:
+        # Connection has already been disconnected
         pass
+    else:
+        queue.expect('dbus-signal', signal='StatusChanged',
+            args=[cs.CONN_STATUS_DISCONNECTED, cs.CSR_REQUESTED])
 
 def exec_tests(funs, params=None, protocol=None, timeout=None,
                authenticator=None):
-- 
1.5.6.5




More information about the telepathy-commits mailing list