Skip to content

Commit

Permalink
repr(socket.error) is useless in some versions of python.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
apenwarr committed Mar 21, 2011
1 parent cfb2592 commit 9031de1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ssnet.py
Expand Up @@ -86,7 +86,7 @@ class SockWrapper:
def __init__(self, rsock, wsock, connect_to=None, peername=None):
global _swcount
_swcount += 1
debug3('creating new SockWrapper (%d now exist\n)' % _swcount)
debug3('creating new SockWrapper (%d now exist)\n' % _swcount)
self.exc = None
self.rsock = rsock
self.wsock = wsock
Expand All @@ -101,7 +101,7 @@ def __del__(self):
_swcount -= 1
debug1('%r: deleting (%d remain)\n' % (self, _swcount))
if self.exc:
debug1('%r: error was: %r\n' % (self, self.exc))
debug1('%r: error was: %s\n' % (self, self.exc))

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

0 comments on commit 9031de1

Please sign in to comment.