"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "3170af71e1df8a9f7b7ef33ba8388dc630d65d79"
Unverified Commit de29ff9b authored by Julien Plu's avatar Julien Plu Committed by GitHub
Browse files

Fix open (#9368)

parent d018afce
...@@ -315,7 +315,7 @@ def find_all_documented_objects(): ...@@ -315,7 +315,7 @@ def find_all_documented_objects():
""" Parse the content of all doc files to detect which classes and functions it documents""" """ Parse the content of all doc files to detect which classes and functions it documents"""
documented_obj = [] documented_obj = []
for doc_file in Path(PATH_TO_DOC).glob("**/*.rst"): for doc_file in Path(PATH_TO_DOC).glob("**/*.rst"):
with open(doc_file) as f: with open(doc_file, "r", encoding="utf-8", newline="\n") as f:
content = f.read() content = f.read()
raw_doc_objs = re.findall(r"(?:autoclass|autofunction):: transformers.(\S+)\s+", content) raw_doc_objs = re.findall(r"(?:autoclass|autofunction):: transformers.(\S+)\s+", content)
documented_obj += [obj.split(".")[-1] for obj in raw_doc_objs] documented_obj += [obj.split(".")[-1] for obj in raw_doc_objs]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment