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

[tor-commits] [stem/master] Convert keys before reporting error



commit ef5c552e59017936699048d680f5f377f1b60d66
Author: Sean Robinson <seankrobinson@xxxxxxxxx>
Date:   Sat Dec 22 04:17:38 2012 -0700

    Convert keys before reporting error
    
    Non-string argument keys caused the ", ".join() to fail with a TypeError.
    Also, remove the the space in the join so that there is only one parameter
    passed to the string substitution.
    
    Signed-off-by: Sean Robinson <seankrobinson@xxxxxxxxx>
---
 test/mocking.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/test/mocking.py b/test/mocking.py
index 20ac76e..fa9e71f 100644
--- a/test/mocking.py
+++ b/test/mocking.py
@@ -223,7 +223,8 @@ def return_for_args(args_to_return_value, default = None):
       return args_to_return_value[args]
     elif default is None:
       arg_label = ", ".join([str(v) for v in args])
-      raise ValueError("Unrecognized argument sent for return_for_args(). Got '%s' but we only recognize '%s'." % (arg_label, ", ".join(args_to_return_value.keys())))
+      arg_keys = ";".join([str(v) for v in args_to_return_value.keys()])
+      raise ValueError("Unrecognized argument sent for return_for_args(). Got '%s' but we only recognize '%s'." % (arg_label, arg_keys))
     else:
       return default(args)
   



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