[tor-commits] [bridgedb/master] Fix an error where `PortList`s could not be indexed by strings.

isis at torproject.org isis at torproject.org
Sun Jan 12 06:06:34 UTC 2014


commit fd62b1261ef5d3c28506191759176d3ae2a71676
Author: Isis Lovecruft <isis at torproject.org>
Date:   Tue Dec 10 11:27:35 2013 +0000

    Fix an error where `PortList`s could not be indexed by strings.
    
    The `long` in #10333 should index the PortList as a string, not an integer.
    
     * FIXES #10333
---
 lib/bridgedb/parse/addr.py |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/bridgedb/parse/addr.py b/lib/bridgedb/parse/addr.py
index 7347bd1..927de2f 100644
--- a/lib/bridgedb/parse/addr.py
+++ b/lib/bridgedb/parse/addr.py
@@ -368,5 +368,4 @@ class PortList(object):
         :rtype: integer
         :returns: The ``port``, if it is in this PortList.
         """
-        portlist = list(self.ports)
-        return portlist[portlist.index(port)]
+        return list(self.ports)[port]





More information about the tor-commits mailing list