Permalink
Browse files

Properly raise exceptions, don't try to concatenate two different dat…

…a types
  • Loading branch information...
1 parent a7350a4 commit aa0752edcd668965b7ff1416611fdf27d1b2e9d1 @thefinn93 thefinn93 committed Jul 5, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 contrib/python/cjdns.py
View
@@ -56,7 +56,7 @@ def cjdns_connect(ipAddr, port, password):
sock.send('d1:q4:pinge');
data = sock.recv(BUFFER_SIZE);
if (data != 'd1:q4:ponge'):
- raise Exception("Looks like " + ipAddr + ":" + port + " is to a non-cjdns socket.");
+ raise Exception("Looks like " + ipAddr + ":" + str(port) + " is to a non-cjdns socket.");
# Get the functions and make the object
sock.send('d1:q7:invalide');
@@ -104,7 +104,7 @@ def cjdns_connect(ipAddr, port, password):
# Check our password.
ret = callfunc(cjdns, "ping", password, {});
if ('error' in ret):
- raise Exception("Connect failed, incorrect admin password?\n" + ret);
+ raise Exception("Connect failed, incorrect admin password?\n" + str(ret))
cjdns.functions = "";
nl = "";

0 comments on commit aa0752e

Please sign in to comment.