##// END OF EJS Templates
convert: stop using the `pycompat.open()` shim
Matt Harbison -
r53272:bb07b1ca default
parent child Browse files
Show More
@@ -22,7 +22,6 from typing import (
22 22 )
23 23
24 24 from mercurial.i18n import _
25 from mercurial.pycompat import open
26 25 from mercurial import (
27 26 encoding,
28 27 error,
@@ -91,7 +90,7 def shlexer(
91 90 whitespace: Optional[bytes] = None,
92 91 ):
93 92 if data is None:
94 data = open(filepath, b'r', encoding='latin1')
93 data = open(filepath, 'r', encoding='latin1')
95 94 else:
96 95 if filepath is not None:
97 96 raise error.ProgrammingError(
@@ -574,7 +573,7 class mapfile(dict):
574 573 if not self.path:
575 574 return
576 575 try:
577 fp = open(self.path, b'rb')
576 fp = open(self.path, 'rb')
578 577 except FileNotFoundError:
579 578 return
580 579
@@ -600,7 +599,7 class mapfile(dict):
600 599 def __setitem__(self, key, value) -> None:
601 600 if self.fp is None:
602 601 try:
603 self.fp = open(self.path, b'ab')
602 self.fp = open(self.path, 'ab')
604 603 except IOError as err:
605 604 raise error.Abort(
606 605 _(b'could not open map file %r: %s')
General Comments 0
You need to be logged in to leave comments. Login now