From 3bca523a8c249cb244469e961790b6b56581f2d2 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Thu, 11 Jun 2009 17:51:17 +0000 Subject: use multi-with syntax --- Lib/filecmp.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Lib/filecmp.py b/Lib/filecmp.py index a2266d8..89a4835 100644 --- a/Lib/filecmp.py +++ b/Lib/filecmp.py @@ -11,7 +11,6 @@ Functions: import os import stat -import contextlib from itertools import ifilter, ifilterfalse, imap, izip __all__ = ["cmp","dircmp","cmpfiles"] @@ -63,7 +62,7 @@ def _sig(st): def _do_cmp(f1, f2): bufsize = BUFSIZE - with contextlib.nested(open(f1, 'rb'), open(f2, 'rb')) as (fp1, fp2): + with open(f1, 'rb') as fp1, open(f2, 'rb') as fp2: while True: b1 = fp1.read(bufsize) b2 = fp2.read(bufsize) -- cgit v0.12