[or-cvs] r15992: Remove finally block after multiple excepts. This seems to f (torflow/branches/gsoc2008)

mikeperry at seul.org mikeperry at seul.org
Wed Jul 16 18:14:06 UTC 2008


Author: mikeperry
Date: 2008-07-16 14:14:06 -0400 (Wed, 16 Jul 2008)
New Revision: 15992

Modified:
   torflow/branches/gsoc2008/soat.py
Log:

Remove finally block after multiple excepts. This seems to
fix python 2.4 issues for me. Aleksei, you may want to look
over this to make sure that socket.socket is being reset in
the same cases, but it looks fine to me.



Modified: torflow/branches/gsoc2008/soat.py
===================================================================
--- torflow/branches/gsoc2008/soat.py	2008-07-16 18:01:59 UTC (rev 15991)
+++ torflow/branches/gsoc2008/soat.py	2008-07-16 18:14:06 UTC (rev 15992)
@@ -513,13 +513,13 @@
         except socket.gaierror, e:
             plog('ERROR', 'A connection error occured while testing smtp at ' + address)
             plog('ERROR', e)
+            socket.socket = defaultsocket 
             return TEST_INCONCLUSIVE
         except Exception, e:
             plog('ERROR','An error occured while testing smtp at ' + address)
             plog('ERROR', e)
-        finally:
-            # reset the connection method back to direct
-            socket.socket = defaultsocket 
+        # reset the connection method back to direct
+        socket.socket = defaultsocket 
 
         # check whether the test was valid at all
         exit_node = self.get_exit_node()
@@ -627,10 +627,10 @@
 
         except Exception, e:
             plog('ERROR', e)
+            socket.socket = defaultsocket
             return TEST_INCONCLUSIVE
-        finally:
-            # reset the connection to default
-            socket.socket = defaultsocket
+        # reset the connection to default
+        socket.socket = defaultsocket
 
         # do the same for the direct connection
 
@@ -764,9 +764,9 @@
 
         except Exception, e:
             plog('ERROR', e)
+            socket.socket = defaultsocket 
             return TEST_INCONCLUSIVE
-        finally:
-            socket.socket = defaultsocket 
+        socket.socket = defaultsocket 
 
         # do the same for the direct connection
         capabilities_ok_d = None



More information about the tor-commits mailing list