diff --git a/build-manifest.py b/build-manifest.py index b10f6b5..a90a229 100644 --- a/build-manifest.py +++ b/build-manifest.py @@ -134,7 +134,10 @@ def resolve_in_repo(repo_root: str, rel: str): def read_text(repo_root: str, name: str): p = os.path.join(repo_root, name) - return open(p, encoding="utf-8").read() if os.path.isfile(p) else None + if not os.path.isfile(p): + return None + with open(p, encoding="utf-8") as fh: + return fh.read() def parse_readme_sections(repo_root: str) -> dict: