From ccd643cdbd7ba752727d62051058a4454451414d Mon Sep 17 00:00:00 2001 From: "Jeremy T. Bouse" Date: Mon, 22 Sep 2014 09:21:39 -0400 Subject: Imported Upstream version 1.15.0 --- paramiko/sftp_handle.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'paramiko/sftp_handle.py') diff --git a/paramiko/sftp_handle.py b/paramiko/sftp_handle.py index 92dd9cf..edceb5a 100644 --- a/paramiko/sftp_handle.py +++ b/paramiko/sftp_handle.py @@ -22,9 +22,10 @@ Abstraction of an SFTP file handle (for server mode). import os from paramiko.sftp import SFTP_OP_UNSUPPORTED, SFTP_OK +from paramiko.util import ClosingContextManager -class SFTPHandle (object): +class SFTPHandle (ClosingContextManager): """ Abstract object representing a handle to an open file (or folder) in an SFTP server implementation. Each handle has a string representation used @@ -32,6 +33,8 @@ class SFTPHandle (object): Server implementations can (and should) subclass SFTPHandle to implement features of a file handle, like `stat` or `chattr`. + + Instances of this class may be used as context managers. """ def __init__(self, flags=0): """ -- cgit v1.2.3