patch: stop using the `pycompat.open()` shim
authorMatt Harbison <matt_harbison@yahoo.com>
Wed, 04 Dec 2024 22:13:05 -0500
changeset 52379 c921c23a9681
parent 52378 e1f0125bb8c6
child 52380 f94efae47eb3
patch: stop using the `pycompat.open()` shim
mercurial/patch.py
--- a/mercurial/patch.py	Wed Dec 04 22:11:31 2024 -0500
+++ b/mercurial/patch.py	Wed Dec 04 22:13:05 2024 -0500
@@ -22,7 +22,6 @@
     sha1nodeconstants,
     short,
 )
-from .pycompat import open
 from . import (
     copies,
     diffhelper,
@@ -2382,7 +2381,7 @@
 
     store = filestore()
     try:
-        fp = open(patchobj, b'rb')
+        fp = open(patchobj, 'rb')
     except TypeError:
         fp = patchobj
     try:
@@ -2458,7 +2457,7 @@
 def changedfiles(ui, repo, patchpath, strip=1, prefix=b''):
     backend = fsbackend(ui, repo.root)
     prefix = _canonprefix(repo, prefix)
-    with open(patchpath, b'rb') as fp:
+    with open(patchpath, 'rb') as fp:
         changed = set()
         for state, values in iterhunks(fp):
             if state == b'file':