[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [bridgedb/master] Return the port if it passes addr.PortList._sanitycheck().
commit b362ce61762dd3c32b801aa69b58b1521db0a82e
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date: Sat Dec 7 04:39:07 2013 +0000
Return the port if it passes addr.PortList._sanitycheck().
This ensures that the return value has truthiness.
---
lib/bridgedb/parse/addr.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/bridgedb/parse/addr.py b/lib/bridgedb/parse/addr.py
index d0137d9..3d8c9b9 100644
--- a/lib/bridgedb/parse/addr.py
+++ b/lib/bridgedb/parse/addr.py
@@ -309,6 +309,7 @@ class PortList(object):
"""
if (not isinstance(port, int)) or not (0 < port <= 65535):
raise InvalidPort("%s is not a valid port number!" % port)
+ return port
def __contains__(self, port):
"""Determine whether ``port`` is already in this ``PortList``.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits