comparison hgext/remotefilelog/debugcommands.py @ 52383:51df2bf7c40b

remotefilelog: stop using the `pycompat.open()` shim
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 05 Dec 2024 12:46:21 -0500
parents 2876d077a796
children 94fa2543d710
comparison
equal deleted inserted replaced
52382:ea79fa8a36ae 52383:51df2bf7c40b
15 hex, 15 hex,
16 sha1nodeconstants, 16 sha1nodeconstants,
17 short, 17 short,
18 ) 18 )
19 from mercurial.i18n import _ 19 from mercurial.i18n import _
20 from mercurial.pycompat import open
21 from mercurial import ( 20 from mercurial import (
22 error, 21 error,
23 filelog, 22 filelog,
24 lock as lockmod, 23 lock as lockmod,
25 pycompat, 24 pycompat,
226 def _decompressblob(raw): 225 def _decompressblob(raw):
227 return zlib.decompress(raw) 226 return zlib.decompress(raw)
228 227
229 228
230 def parsefileblob(path, decompress): 229 def parsefileblob(path, decompress):
231 f = open(path, b"rb") 230 f = open(path, "rb")
232 try: 231 try:
233 raw = f.read() 232 raw = f.read()
234 finally: 233 finally:
235 f.close() 234 f.close()
236 235