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

[tor-commits] [bridgedb/master] Only parse PT args if there is an arg present.



commit a7da6a642290d1ce2c9eb2d8545dc6a30b1d170c
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Wed Dec 24 08:55:15 2014 +0000

    Only parse PT args if there is an arg present.
---
 lib/bridgedb/bridges.py |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/lib/bridgedb/bridges.py b/lib/bridgedb/bridges.py
index 4968988..735c603 100644
--- a/lib/bridgedb/bridges.py
+++ b/lib/bridgedb/bridges.py
@@ -312,13 +312,14 @@ class PluggableTransport(BridgeAddressBase):
         allArguments = ','.join(argumentList)
 
         for arg in allArguments.split(','):
-            try:
-                key, value = arg.split('=')
-            except ValueError:
-                logging.warn("  Couldn't parse K=V from PT arg: %r" % arg)
-            else:
-                logging.debug("  Parsed PT Argument: %s: %s" % (key, value))
-                argDict[key] = value
+            if arg:  # It might be an empty string
+                try:
+                    key, value = arg.split('=')
+                except ValueError:
+                    logging.warn("  Couldn't parse K=V from PT arg: %r" % arg)
+                else:
+                    logging.debug("  Parsed PT Argument: %s: %s" % (key, value))
+                    argDict[key] = value
 
         return argDict
 



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