[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [stem/master] Skip port validity for Controller.from_port() with the default



commit 6c40ef5779db5d1b6ffc6f75720c972dd6258f0c
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sat May 23 12:32:14 2015 -0700

    Skip port validity for Controller.from_port() with the default
    
    Oops, we shouldn't try to validate the port when it's 'default'. Our tests
    caught this for the connection module, but didn't exercise it here.
---
 stem/control.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/stem/control.py b/stem/control.py
index 26272fd..544e3a2 100644
--- a/stem/control.py
+++ b/stem/control.py
@@ -920,7 +920,7 @@ class Controller(BaseController):
 
     if not stem.util.connection.is_valid_ipv4_address(address):
       raise ValueError('Invalid IP address: %s' % address)
-    elif not stem.util.connection.is_valid_port(port):
+    elif port != 'default' and not stem.util.connection.is_valid_port(port):
       raise ValueError('Invalid port: %s' % port)
 
     if port == 'default':

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits