changeset 52410:e1f0125bb8c6

server: stop using the `pycompat.open()` shim
author Matt Harbison <matt_harbison@yahoo.com>
date Wed, 04 Dec 2024 22:11:31 -0500
parents ef83646d5f7d
children c921c23a9681
files mercurial/server.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/server.py	Wed Dec 04 22:07:56 2024 -0500
+++ b/mercurial/server.py	Wed Dec 04 22:11:31 2024 -0500
@@ -10,7 +10,6 @@
 import os
 
 from .i18n import _
-from .pycompat import open
 
 from . import (
     chgserver,
@@ -76,9 +75,9 @@
     def writepid(pid):
         if opts[b'pid_file']:
             if appendpid:
-                mode = b'ab'
+                mode = 'ab'
             else:
-                mode = b'wb'
+                mode = 'wb'
             fp = open(opts[b'pid_file'], mode)
             fp.write(b'%d\n' % pid)
             fp.close()
@@ -109,7 +108,7 @@
                 # If the daemonized process managed to write out an error msg,
                 # report it.
                 if pycompat.iswindows and os.path.exists(lockpath):
-                    with open(lockpath, b'rb') as log:
+                    with open(lockpath, 'rb') as log:
                         for line in log:
                             procutil.stderr.write(line)
                 raise error.Abort(_(b'child process failed to start'))