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

[tor-commits] [bridgedb/master] Only return the re-padded base64 string if no errors were raised.



commit c5dc0a3e32169a65e72709e30af2b4ab94ac833d
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Wed Dec 11 13:21:48 2013 +0000

    Only return the re-padded base64 string if no errors were raised.
    
     * CHANGE parse.padBase64() to only return a value if no exceptions were
       raised during parsing.
---
 lib/bridgedb/parse/__init__.py |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/bridgedb/parse/__init__.py b/lib/bridgedb/parse/__init__.py
index 21cfe30..f4b75d1 100644
--- a/lib/bridgedb/parse/__init__.py
+++ b/lib/bridgedb/parse/__init__.py
@@ -48,5 +48,5 @@ def padBase64(b64string):
         if not addchars:
             raise ValueError("Invalid base64-encoded string: %r" % b64string)
         b64string += '=' * addchars
-    finally:
-        return b64string
+
+    return b64string



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