Author: junglecow
Date: 2006-11-28 23:12:03 +0100 (Tue, 28 Nov 2006)
New Revision: 7559
Modified:
branches/pyopenssl/src/common/xmpp/transports_nb.py
Log:
[pyopenssl] More exception fixes
Modified: branches/pyopenssl/src/common/xmpp/transports_nb.py
===================================================================
--- branches/pyopenssl/src/common/xmpp/transports_nb.py 2006-11-28 16:41:31 UTC (rev 7558)
+++ branches/pyopenssl/src/common/xmpp/transports_nb.py 2006-11-28 22:12:03 UTC (rev 7559)
@@ -81,10 +81,10 @@
this.exc = exc
- this.errno = errno or gattr(this.exc, 'errno', 0)
- this.strerror = strerror or gattr(this.exc, 'strerror') or gattr(this.exc, 'args')
+ errno = errno or gattr(this.exc, 'errno', 0)
+ strerror = strerror or gattr(this.exc, 'strerror') or gattr(this.exc, 'args')
- this.parent.__init__(this, errno, strerror)
+ this.parent.__init__(this, this.errno, this.strerror)
this.peer = peer
this.exc_name = None
@@ -111,7 +111,7 @@
s += ", Caused by %s" % this.exc_name
if this.exc_str:
if this.strerror: s += "(%s)" % this.exc_str
- else: s += "(%s)" % this.exc_args
+ else: s += "(%s)" % str(this.exc_args)
return s
def __init__(this, sslobj, sock=None):
@@ -177,7 +177,7 @@
log.debug("Send: " + repr(e))
time.sleep(0.1) # prevent 100% CPU usage
except OpenSSL.SSL.SysCallError, e:
- log.error("Recv: Got OpenSSL.SSL.SysCallError: " + repr(e))
+ log.error("Send: Got OpenSSL.SSL.SysCallError: " + repr(e))
traceback.print_exc()
raise SSLWrapper.Error(this.sock or this.sslobj, e)
except OpenSSL.SSL.Error, e: