diff options
author | Avery Pennarun <apenwarr@gmail.com> | 2011-03-21 02:25:35 -0700 |
---|---|---|
committer | Avery Pennarun <apenwarr@gmail.com> | 2011-03-21 03:15:11 -0700 |
commit | 9031de1527a3ef377eedfd99a67496ec7ed5c102 (patch) | |
tree | 8593935381b0e6257a11fc37b5b02a4e09f2ac33 | |
parent | cfb2592346d206c9f0b7307375665a5697e86043 (diff) |
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.
-rw-r--r-- | ssnet.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 @@ -101,7 +101,7 @@ class SockWrapper: _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: @@ -129,7 +129,7 @@ class SockWrapper: # 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: |