Mercurial > public > mercurial-scm > hg
changeset 52366:c9baa3541b20
hgweb: stop using the `pycompat.open()` shim
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 04 Dec 2024 20:54:35 -0500 |
parents | bff68b6e5999 |
children | 89126d55e18c |
files | mercurial/hgweb/common.py mercurial/hgweb/server.py |
diffstat | 2 files changed, 2 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/hgweb/common.py Wed Dec 04 20:53:31 2024 -0500 +++ b/mercurial/hgweb/common.py Wed Dec 04 20:54:35 2024 -0500 @@ -15,9 +15,6 @@ import stat from ..i18n import _ -from ..pycompat import ( - open, -) from .. import ( encoding, pycompat, @@ -222,7 +219,7 @@ path = os.path.join(directory, fpath) try: os.stat(path) - with open(path, b'rb') as fh: + with open(path, 'rb') as fh: data = fh.read() except TypeError: raise ErrorResponse(HTTP_SERVER_ERROR, b'illegal filename')
--- a/mercurial/hgweb/server.py Wed Dec 04 20:53:31 2024 -0500 +++ b/mercurial/hgweb/server.py Wed Dec 04 20:54:35 2024 -0500 @@ -15,9 +15,6 @@ import wsgiref.validate from ..i18n import _ -from ..pycompat import ( - open, -) from .. import ( encoding, @@ -351,7 +348,7 @@ def openlog(opt, default): if opt and opt != b'-': - return open(opt, b'ab') + return open(opt, 'ab') return default