[tor-commits] [stem/master] Drop python 2.x exception normalization

atagar at torproject.org atagar at torproject.org
Sun Jan 5 21:39:28 UTC 2020


commit 7d4b94de2ca18e6793adb3c931b63471ff6df1ef
Author: Damian Johnson <atagar at torproject.org>
Date:   Sun Jan 5 12:18:52 2020 -0800

    Drop python 2.x exception normalization
---
 stem/socket.py | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/stem/socket.py b/stem/socket.py
index 4105152f..a62bb6b3 100644
--- a/stem/socket.py
+++ b/stem/socket.py
@@ -669,14 +669,8 @@ def recv_message(control_file, arrived_at = None):
 
       log.info(ERROR_MSG % ('SocketClosed', 'socket file has been closed'))
       raise stem.SocketClosed('socket file has been closed')
-    except (socket.error, ValueError) as exc:
-      # When disconnected we get...
-      #
-      # Python 2:
-      #   socket.error: [Errno 107] Transport endpoint is not connected
-      #
-      # Python 3:
-      #   ValueError: I/O operation on closed file.
+    except ValueError as exc:
+      # when disconnected this errors with 'I/O operation on closed file'
 
       log.info(ERROR_MSG % ('SocketClosed', 'received exception "%s"' % exc))
       raise stem.SocketClosed(exc)





More information about the tor-commits mailing list