Skip to content

Commit 9031de1

Browse files
committed
repr(socket.error) is useless in some versions of python.
So let's use %s instead of %r to print it, so that log messages can be more useful. This only affects one message at debug3 for now, so it's not too exciting.
1 parent cfb2592 commit 9031de1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ssnet.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class SockWrapper:
8686
def __init__(self, rsock, wsock, connect_to=None, peername=None):
8787
global _swcount
8888
_swcount += 1
89-
debug3('creating new SockWrapper (%d now exist\n)' % _swcount)
89+
debug3('creating new SockWrapper (%d now exist)\n' % _swcount)
9090
self.exc = None
9191
self.rsock = rsock
9292
self.wsock = wsock
@@ -101,7 +101,7 @@ def __del__(self):
101101
_swcount -= 1
102102
debug1('%r: deleting (%d remain)\n' % (self, _swcount))
103103
if self.exc:
104-
debug1('%r: error was: %r\n' % (self, self.exc))
104+
debug1('%r: error was: %s\n' % (self, self.exc))
105105

106106
def __repr__(self):
107107
if self.rsock == self.wsock:
@@ -129,7 +129,7 @@ def try_connect(self):
129129
# connected successfully (Linux)
130130
self.connect_to = None
131131
except socket.error, e:
132-
debug3('%r: connect result: %r\n' % (self, e))
132+
debug3('%r: connect result: %s\n' % (self, e))
133133
if e.args[0] in [errno.EINPROGRESS, errno.EALREADY]:
134134
pass # not connected yet
135135
elif e.args[0] == errno.EISCONN:

0 commit comments

Comments
 (0)