[tor-commits] [bridgedb/develop] Catch ValueErrors while coercing PluggableTransport port numbers.

isis at torproject.org isis at torproject.org
Thu Feb 19 02:21:13 UTC 2015


commit 83378640b09dc8a6c6d5a58389fd36c25dab37b1
Author: Isis Lovecruft <isis at torproject.org>
Date:   Sat Dec 6 00:17:24 2014 +0000

    Catch ValueErrors while coercing PluggableTransport port numbers.
---
 lib/bridgedb/bridges.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/bridgedb/bridges.py b/lib/bridgedb/bridges.py
index 21d9257..ecbf863 100644
--- a/lib/bridgedb/bridges.py
+++ b/lib/bridgedb/bridges.py
@@ -240,7 +240,7 @@ class PluggableTransport(object):
         try:
             # Coerce the port to be an integer:
             self.port = int(self.port)
-        except TypeError:
+        except (TypeError, ValueError):
             raise MalformedPluggableTransport(
                 ("Cannot create PluggableTransport with port type: %s.")
                 % type(self.port))





More information about the tor-commits mailing list