diff mercurial/extensions.py @ 52601:f106d0e629e5

extensions: replace a trivial file read with the `util` function
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 17 Dec 2024 01:00:59 -0500
parents 89126d55e18c
children 24ee91ba9aa8
line wrap: on
line diff
--- a/mercurial/extensions.py	Tue Dec 17 00:56:01 2024 -0500
+++ b/mercurial/extensions.py	Tue Dec 17 01:00:59 2024 -0500
@@ -885,8 +885,7 @@
 
     This may raise IOError or SyntaxError.
     """
-    with open(path, 'rb') as src:
-        root = ast.parse(src.read(), path)
+    root = ast.parse(util.readfile(path), path)
     cmdtable = {}
 
     # Python 3.12 started removing Bytes and Str and deprecate harder