diff mercurial/debugcommands.py @ 52400:9746e618c151

debugcommands: stop using the `pycompat.open()` shim Some of these callers were already compatible.
author Matt Harbison <matt_harbison@yahoo.com>
date Wed, 04 Dec 2024 21:03:05 -0500
parents a021da4ec509
children 8dede0df9de9
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Wed Dec 04 20:57:35 2024 -0500
+++ b/mercurial/debugcommands.py	Wed Dec 04 21:03:05 2024 -0500
@@ -33,9 +33,6 @@
     nullrev,
     short,
 )
-from .pycompat import (
-    open,
-)
 from . import (
     bundle2,
     bundlerepo,
@@ -1384,7 +1381,7 @@
 
     dest = ui
     if output:
-        dest = open(output, b"wb", _chunksize)
+        dest = open(output, "wb", _chunksize)
     try:
         data = fh.read(_chunksize)
         while data:
@@ -3443,7 +3440,7 @@
             # can't seek a pipe, so `ab` mode fails on py3
             logfh = os.fdopen(int(opts['logiofd']), 'wb', 0)
     elif opts['logiofile']:
-        logfh = open(opts['logiofile'], b'ab', 0)
+        logfh = open(opts['logiofile'], 'ab', 0)
 
     s = wireprotoserver.sshserver(ui, repo, logfh=logfh)
     s.serve_forever()
@@ -4699,7 +4696,7 @@
                     continue
 
                 if line.startswith(b'BODYFILE '):
-                    with open(line.split(b' ', 1), b'rb') as fh:
+                    with open(line.split(b' ', 1), 'rb') as fh:
                         body = fh.read()
                 elif line.startswith(b'frame '):
                     frame = wireprotoframing.makeframefromhumanstring(