util: stop using the `pycompat.open()` shim
authorMatt Harbison <matt_harbison@yahoo.com>
Wed, 04 Dec 2024 19:50:32 -0500
changeset 52360 fca7d38e040b
parent 52359 3f0cf7bb3086
child 52361 07a5a249faf8
util: stop using the `pycompat.open()` shim It looks like we don't actually need this leftover from the py2 days.
mercurial/util.py
--- a/mercurial/util.py	Wed Dec 04 23:31:46 2024 +0100
+++ b/mercurial/util.py	Wed Dec 04 19:50:32 2024 -0500
@@ -57,9 +57,6 @@
     # noinspection PyPackageRequirements
     import attr
 
-from .pycompat import (
-    open,
-)
 from hgdemandimport import tracing
 from . import (
     encoding,
@@ -2754,17 +2751,17 @@
 
 
 def readfile(path: bytes) -> bytes:
-    with open(path, b'rb') as fp:
+    with open(path, 'rb') as fp:
         return fp.read()
 
 
 def writefile(path: bytes, text: bytes) -> None:
-    with open(path, b'wb') as fp:
+    with open(path, 'wb') as fp:
         fp.write(text)
 
 
 def appendfile(path: bytes, text: bytes) -> None:
-    with open(path, b'ab') as fp:
+    with open(path, 'ab') as fp:
         fp.write(text)