summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobey Pointer <robey@lag.net>2006-05-10 18:11:40 -0700
committerRobey Pointer <robey@lag.net>2006-05-10 18:11:40 -0700
commit6f4110a06663dc772d228566a8795de395366d38 (patch)
treea6cb548181f43094d7005368c6d66fd80ce81457
parent8843feb633827cb65066ce01f3e0347038cbb10c (diff)
[project @ robey@lag.net-20060511011140-ab3550c28121f900]
fix a few bugs found by pycheck
-rw-r--r--paramiko/channel.py5
-rw-r--r--paramiko/client.py5
-rw-r--r--paramiko/sftp_file.py1
-rw-r--r--paramiko/ssh_exception.py4
4 files changed, 9 insertions, 6 deletions
diff --git a/paramiko/channel.py b/paramiko/channel.py
index a4376e46..b700a1b9 100644
--- a/paramiko/channel.py
+++ b/paramiko/channel.py
@@ -838,8 +838,9 @@ class Channel (object):
self._log(ERROR, 'unknown extended_data type %d; discarding' % code)
return
if self.combine_stderr:
- return self._feed(s)
- self.in_stderr_buffer.feed(s)
+ self._feed(s)
+ else:
+ self.in_stderr_buffer.feed(s)
def _window_adjust(self, m):
nbytes = m.get_int()
diff --git a/paramiko/client.py b/paramiko/client.py
index b7ffbeef..b97445ba 100644
--- a/paramiko/client.py
+++ b/paramiko/client.py
@@ -28,7 +28,7 @@ from paramiko.common import *
from paramiko.dsskey import DSSKey
from paramiko.hostkeys import HostKeys
from paramiko.rsakey import RSAKey
-from paramiko.ssh_exception import SSHException
+from paramiko.ssh_exception import SSHException, BadHostKeyException
from paramiko.transport import Transport
from paramiko.util import hexify
@@ -107,6 +107,7 @@ class SSHClient (object):
self._host_keys_filename = None
self._log_channel = None
self._policy = RejectPolicy()
+ self._transport = None
def load_system_host_keys(self, filename=None):
"""
@@ -378,7 +379,7 @@ class SSHClient (object):
filename = os.path.expanduser('~/.ssh/' + filename)
try:
key = pkey_class.from_private_key_file(filename, password)
- self._log(DEBUG, 'Trying discovered key %s in %s' % (hexify(key.get_fingerprint(), filename)))
+ self._log(DEBUG, 'Trying discovered key %s in %s' % (hexify(key.get_fingerprint()), filename))
self._transport.auth_publickey(username, key)
return
except SSHException, e:
diff --git a/paramiko/sftp_file.py b/paramiko/sftp_file.py
index 28879861..05c10458 100644
--- a/paramiko/sftp_file.py
+++ b/paramiko/sftp_file.py
@@ -22,6 +22,7 @@ L{SFTPFile}
import socket
import threading
+import time
from paramiko.common import *
from paramiko.sftp import *
from paramiko.file import BufferedFile
diff --git a/paramiko/ssh_exception.py b/paramiko/ssh_exception.py
index 55b0197f..12759637 100644
--- a/paramiko/ssh_exception.py
+++ b/paramiko/ssh_exception.py
@@ -62,7 +62,7 @@ class BadAuthenticationType (AuthenticationException):
allowed_types = []
def __init__(self, explanation, types):
- SSHException.__init__(self, explanation)
+ AuthenticationException.__init__(self, explanation)
self.allowed_types = types
def __str__(self):
@@ -76,7 +76,7 @@ class PartialAuthentication (AuthenticationException):
allowed_types = []
def __init__(self, types):
- SSHException.__init__(self, 'partial authentication')
+ AuthenticationException.__init__(self, 'partial authentication')
self.allowed_types = types