From e0b323d7fb0d355bf7fcc469d3a24bd5a55f7ee4 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 29 Sep 2013 17:52:59 +0100 Subject: Turn BufferedFile into a context manager --- paramiko/file.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'paramiko/file.py') diff --git a/paramiko/file.py b/paramiko/file.py index 2238f0bf..09998829 100644 --- a/paramiko/file.py +++ b/paramiko/file.py @@ -19,8 +19,10 @@ from paramiko.common import linefeed_byte_value, crlf, cr_byte, linefeed_byte, \ cr_byte_value from paramiko.py3compat import BytesIO, PY2, u, b, bytes_types +from paramiko.util import ClosingContextManager -class BufferedFile (object): + +class BufferedFile (ClosingContextManager): """ Reusable base class to implement Python-style file buffering around a simpler stream. -- cgit v1.2.1