Mercurial > public > mercurial-scm > hg-stable
comparison 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 |
comparison
equal
deleted
inserted
replaced
52600:cac851655570 | 52601:f106d0e629e5 |
---|---|
883 def _disabledcmdtable(path): | 883 def _disabledcmdtable(path): |
884 """Construct a dummy command table without loading the extension module | 884 """Construct a dummy command table without loading the extension module |
885 | 885 |
886 This may raise IOError or SyntaxError. | 886 This may raise IOError or SyntaxError. |
887 """ | 887 """ |
888 with open(path, 'rb') as src: | 888 root = ast.parse(util.readfile(path), path) |
889 root = ast.parse(src.read(), path) | |
890 cmdtable = {} | 889 cmdtable = {} |
891 | 890 |
892 # Python 3.12 started removing Bytes and Str and deprecate harder | 891 # Python 3.12 started removing Bytes and Str and deprecate harder |
893 use_constant = 'Bytes' not in vars(ast) | 892 use_constant = 'Bytes' not in vars(ast) |
894 | 893 |