Kaydet (Commit) 3bca523a authored tarafından Benjamin Peterson's avatar Benjamin Peterson

use multi-with syntax

üst b266481e
...@@ -11,7 +11,6 @@ Functions: ...@@ -11,7 +11,6 @@ Functions:
import os import os
import stat import stat
import contextlib
from itertools import ifilter, ifilterfalse, imap, izip from itertools import ifilter, ifilterfalse, imap, izip
__all__ = ["cmp","dircmp","cmpfiles"] __all__ = ["cmp","dircmp","cmpfiles"]
...@@ -63,7 +62,7 @@ def _sig(st): ...@@ -63,7 +62,7 @@ def _sig(st):
def _do_cmp(f1, f2): def _do_cmp(f1, f2):
bufsize = BUFSIZE 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: while True:
b1 = fp1.read(bufsize) b1 = fp1.read(bufsize)
b2 = fp2.read(bufsize) b2 = fp2.read(bufsize)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment