We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 064f972 commit bee4516Copy full SHA for bee4516
library/python/testing/yatest_common/yatest/common/canonical.py
@@ -14,10 +14,11 @@
14
15
def _copy(src, dst, universal_lines=False):
16
if universal_lines:
17
- with open(dst, "wb") as f:
+ with open(dst, "wb") as f_dst:
18
mode = "rbU" if six.PY2 else "rb"
19
- for line in open(src, mode):
20
- f.write(line)
+ with open(src, mode) as f_src:
+ for line in f_src:
21
+ f_dst.write(line)
22
return
23
shutil.copy(src, dst)
24
0 commit comments