Fix string formatting when port is not given.

If port is None, we would try to format an empty string with %d wich
fails. Fix it by using %s.

Reported-by: Iain Dalton <iain.dalton@gmail.com>
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth 2011-09-30 10:59:07 +02:00
parent 3885acf87d
commit 0ba9634205

View File

@ -232,7 +232,7 @@ class UIBase:
if s.verbose < 0: return
displaystr = ''
hostname = hostname if hostname else ''
port = "%d" % port if port else ''
port = "%s" % port if port else ''
if hostname:
displaystr = ' to %s:%s' % (hostname, port)
s._msg("Establishing connection%s" % displaystr)