summaryrefslogtreecommitdiff
path: root/paramiko/sftp_file.py
diff options
context:
space:
mode:
authorScott Maxwell <scott@codecobblers.com>2013-10-30 16:46:33 -0700
committerScott Maxwell <scott@codecobblers.com>2013-10-30 16:46:33 -0700
commit2ea352b8baf1037bd22fc79146ef646c163a7692 (patch)
tree439892d24b7659bb4345790af09582aaa0162377 /paramiko/sftp_file.py
parent6bd1e42b43017c8df3edd826fad5aca798538b10 (diff)
downloadparamiko-2ea352b8baf1037bd22fc79146ef646c163a7692.tar.gz
Fix dict iters, sorts, exceptions, bytes renames and tuple args
Diffstat (limited to 'paramiko/sftp_file.py')
-rw-r--r--paramiko/sftp_file.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/paramiko/sftp_file.py b/paramiko/sftp_file.py
index 4ec936d0..c0bc898f 100644
--- a/paramiko/sftp_file.py
+++ b/paramiko/sftp_file.py
@@ -94,7 +94,7 @@ class SFTPFile (BufferedFile):
k = [i for i in self._prefetch_reads if i[0] <= offset]
if len(k) == 0:
return False
- k.sort(lambda x, y: cmp(x[0], y[0]))
+ k.sort(key=hash)
buf_offset, buf_size = k[-1]
if buf_offset + buf_size <= offset:
# prefetch request ends before this one begins
@@ -464,8 +464,8 @@ class SFTPFile (BufferedFile):
# save exception and re-raise it on next file operation
try:
self.sftp._convert_status(msg)
- except Exception, x:
- self._saved_exception = x
+ except Exception:
+ self._saved_exception = sys.exc_info()[1]
return
if t != CMD_DATA:
raise SFTPError('Expected data')