summaryrefslogtreecommitdiff
path: root/paramiko/sftp_handle.py
diff options
context:
space:
mode:
authorRobey Pointer <robey@lag.net>2005-07-10 09:56:00 +0000
committerRobey Pointer <robey@lag.net>2005-07-10 09:56:00 +0000
commit0ac7b0dcbd43b5077b74bb5072d5f5e2423371d7 (patch)
tree09651c42bfa91989506104915b0d6d100e40c604 /paramiko/sftp_handle.py
parent5ba8b47a458560e6170b5635daf9db1211eadf61 (diff)
downloadparamiko-0ac7b0dcbd43b5077b74bb5072d5f5e2423371d7.tar.gz
[project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-29]
a bunch of silly changes where i was trying to fix pychecker warnings before i decided it wasnt worth the effort
Diffstat (limited to 'paramiko/sftp_handle.py')
-rw-r--r--paramiko/sftp_handle.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/paramiko/sftp_handle.py b/paramiko/sftp_handle.py
index f290e1f6..fc615965 100644
--- a/paramiko/sftp_handle.py
+++ b/paramiko/sftp_handle.py
@@ -1,5 +1,3 @@
-#!/usr/bin/python
-
# Copyright (C) 2003-2005 Robey Pointer <robey@lag.net>
#
# This file is part of paramiko.
@@ -54,10 +52,12 @@ class SFTPHandle (object):
using the default implementations of L{read} and L{write}, this
method's default implementation should be fine also.
"""
- if hasattr(self, 'readfile') and (self.readfile is not None):
- self.readfile.close()
- if hasattr(self, 'writefile') and (self.writefile is not None):
- self.writefile.close()
+ readfile = getattr(self, 'readfile', None)
+ if readfile is not None:
+ readfile.close()
+ writefile = getattr(self, 'writefile', None)
+ if writefile is not None:
+ writefile.close()
def read(self, offset, length):
"""