diff options
author | Raymond Hettinger <python@rcn.com> | 2009-06-04 00:11:54 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2009-06-04 00:11:54 (GMT) |
commit | 686057b8facb474a4542a2236f6ca2de7aa04cb5 (patch) | |
tree | ea013d9fa7c2f2d483be38493fd27c4e6d4aa191 /Lib/filecmp.py | |
parent | a678d94d589021363139182e1e8e2f58f319eed7 (diff) | |
download | cpython-686057b8facb474a4542a2236f6ca2de7aa04cb5.zip cpython-686057b8facb474a4542a2236f6ca2de7aa04cb5.tar.gz cpython-686057b8facb474a4542a2236f6ca2de7aa04cb5.tar.bz2 |
Use new form of with-statement instead of contextlib.nested().
Diffstat (limited to 'Lib/filecmp.py')
-rw-r--r-- | Lib/filecmp.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/filecmp.py b/Lib/filecmp.py index 1a86e06..e5983cd 100644 --- a/Lib/filecmp.py +++ b/Lib/filecmp.py @@ -11,7 +11,6 @@ Functions: import os import stat -import contextlib from itertools import filterfalse __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) |