Mercurial > public > mercurial-scm > hg
changeset 52375:bb07b1ca23eb
convert: stop using the `pycompat.open()` shim
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 04 Dec 2024 21:15:30 -0500 |
parents | 472c30a4df0e |
children | 9b43246e710e |
files | hgext/convert/common.py |
diffstat | 1 files changed, 3 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/convert/common.py Wed Dec 04 21:13:40 2024 -0500 +++ b/hgext/convert/common.py Wed Dec 04 21:15:30 2024 -0500 @@ -22,7 +22,6 @@ ) from mercurial.i18n import _ -from mercurial.pycompat import open from mercurial import ( encoding, error, @@ -91,7 +90,7 @@ whitespace: Optional[bytes] = None, ): if data is None: - data = open(filepath, b'r', encoding='latin1') + data = open(filepath, 'r', encoding='latin1') else: if filepath is not None: raise error.ProgrammingError( @@ -574,7 +573,7 @@ if not self.path: return try: - fp = open(self.path, b'rb') + fp = open(self.path, 'rb') except FileNotFoundError: return @@ -600,7 +599,7 @@ def __setitem__(self, key, value) -> None: if self.fp is None: try: - self.fp = open(self.path, b'ab') + self.fp = open(self.path, 'ab') except IOError as err: raise error.Abort( _(b'could not open map file %r: %s')