##// END OF EJS Templates
util: stop using the `pycompat.open()` shim...
Matt Harbison -
r53257:fca7d38e default
parent child Browse files
Show More
@@ -57,9 +57,6 if typing.TYPE_CHECKING:
57 # noinspection PyPackageRequirements
57 # noinspection PyPackageRequirements
58 import attr
58 import attr
59
59
60 from .pycompat import (
61 open,
62 )
63 from hgdemandimport import tracing
60 from hgdemandimport import tracing
64 from . import (
61 from . import (
65 encoding,
62 encoding,
@@ -2754,17 +2751,17 def makedirs(
2754
2751
2755
2752
2756 def readfile(path: bytes) -> bytes:
2753 def readfile(path: bytes) -> bytes:
2757 with open(path, b'rb') as fp:
2754 with open(path, 'rb') as fp:
2758 return fp.read()
2755 return fp.read()
2759
2756
2760
2757
2761 def writefile(path: bytes, text: bytes) -> None:
2758 def writefile(path: bytes, text: bytes) -> None:
2762 with open(path, b'wb') as fp:
2759 with open(path, 'wb') as fp:
2763 fp.write(text)
2760 fp.write(text)
2764
2761
2765
2762
2766 def appendfile(path: bytes, text: bytes) -> None:
2763 def appendfile(path: bytes, text: bytes) -> None:
2767 with open(path, b'ab') as fp:
2764 with open(path, 'ab') as fp:
2768 fp.write(text)
2765 fp.write(text)
2769
2766
2770
2767
General Comments 0
You need to be logged in to leave comments. Login now