[tor-commits] [stem/master] Raising NotImplementedError for _make_socket()

atagar at torproject.org atagar at torproject.org
Thu Feb 9 04:27:53 UTC 2012


commit db0e9ce6d969674a6a46d24d250fe8acd6245af3
Author: Damian Johnson <atagar at torproject.org>
Date:   Wed Feb 8 19:35:36 2012 -0800

    Raising NotImplementedError for _make_socket()
    
    ControlSocket is an abstract class without an implementation for
    _make_socket(). In python the proper type of exception to raise for this is a
    NotImplementedError.
---
 stem/socket.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/stem/socket.py b/stem/socket.py
index 616fd6a..5ae4418 100644
--- a/stem/socket.py
+++ b/stem/socket.py
@@ -242,9 +242,10 @@ class ControlSocket:
     
     Raises:
       stem.socket.SocketError if unable to make a socket
+      NotImplementedError if not implemented by a subclass
     """
     
-    raise SocketError("Unsupported Operation: this should be implemented by the ControlSocket subclass")
+    raise NotImplementedError("Unsupported Operation: this should be implemented by the ControlSocket subclass")
 
 class ControlPort(ControlSocket):
   """





More information about the tor-commits mailing list