summaryrefslogtreecommitdiff
path: root/paramiko/ssh_exception.py
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2014-04-16 15:51:01 -0400
committerJeff Forcier <jeff@bitprophet.org>2014-04-16 15:51:01 -0400
commit30f6f98afd718daf7517b24cd9e85c218f482552 (patch)
tree289b59ab99ffd4aebfd42345ecfc4367ef2aaa86 /paramiko/ssh_exception.py
parent6e9abc39cfff94e0dc36ebe6b939caa8d2eafee0 (diff)
downloadparamiko-30f6f98afd718daf7517b24cd9e85c218f482552.tar.gz
Added self.args for exception classes. Used for unpickling
Related to fabric/fabric#986 and fabric/fabric#714 Conflicts: sites/www/changelog.rst
Diffstat (limited to 'paramiko/ssh_exception.py')
-rw-r--r--paramiko/ssh_exception.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/paramiko/ssh_exception.py b/paramiko/ssh_exception.py
index 63ca6409..b99e42b3 100644
--- a/paramiko/ssh_exception.py
+++ b/paramiko/ssh_exception.py
@@ -59,7 +59,9 @@ class BadAuthenticationType (AuthenticationException):
def __init__(self, explanation, types):
AuthenticationException.__init__(self, explanation)
self.allowed_types = types
-
+ # for unpickling
+ self.args = (explanation, types, )
+
def __str__(self):
return SSHException.__str__(self) + ' (allowed_types=%r)' % self.allowed_types
@@ -73,6 +75,8 @@ class PartialAuthentication (AuthenticationException):
def __init__(self, types):
AuthenticationException.__init__(self, 'partial authentication')
self.allowed_types = types
+ # for unpickling
+ self.args = (types, )
class ChannelException (SSHException):
@@ -86,6 +90,8 @@ class ChannelException (SSHException):
def __init__(self, code, text):
SSHException.__init__(self, text)
self.code = code
+ # for unpickling
+ self.args = (code, text, )
class BadHostKeyException (SSHException):
@@ -103,6 +109,8 @@ class BadHostKeyException (SSHException):
self.hostname = hostname
self.key = got_key
self.expected_key = expected_key
+ # for unpickling
+ self.args = (hostname, got_key, expected_key, )
class ProxyCommandFailure (SSHException):
@@ -119,3 +127,5 @@ class ProxyCommandFailure (SSHException):
)
)
self.error = error
+ # for unpickling
+ self.args = (command, error, )