From 87b9b4e060377f09096db7af977f604749c8a100 Mon Sep 17 00:00:00 2001 From: Lucinda May Phipps Date: Fri, 20 May 2022 16:14:05 +0100 Subject: [PATCH] shutil._copyfileobj_readinto: tiny speedup (#92377) --- Lib/shutil.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/shutil.py b/Lib/shutil.py index de82453aa56..2cbd808abf2 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -182,7 +182,8 @@ def _copyfileobj_readinto(fsrc, fdst, length=COPY_BUFSIZE): break elif n < length: with mv[:n] as smv: - fdst.write(smv) + fdst_write(smv) + break else: fdst_write(mv)