diff mercurial/patch.py @ 52411:c921c23a9681

patch: stop using the `pycompat.open()` shim
author Matt Harbison <matt_harbison@yahoo.com>
date Wed, 04 Dec 2024 22:13:05 -0500
parents f4733654f144
children 24ee91ba9aa8
line wrap: on
line diff
--- 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':