changeset 52600:cac851655570

debugwireproto: replace a trivial file read with the `util` function
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 17 Dec 2024 00:56:01 -0500
parents 006feec78d52
children f106d0e629e5
files mercurial/debugcommands.py
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Tue Dec 17 00:47:42 2024 -0500
+++ b/mercurial/debugcommands.py	Tue Dec 17 00:56:01 2024 -0500
@@ -4712,8 +4712,7 @@
                     continue
 
                 if line.startswith(b'BODYFILE '):
-                    with open(line.split(b' ', 1), 'rb') as fh:
-                        body = fh.read()
+                    body = util.readfile(line.split(b' ', 1))
                 elif line.startswith(b'frame '):
                     frame = wireprotoframing.makeframefromhumanstring(
                         line[len(b'frame ') :]