Skip to content

Commit ed4a551

Browse files
MarkDaoustcopybara-github
authored andcommitted
Catch potential arrtibute-errors.
These attributes don't exist in all contexts. PiperOrigin-RevId: 500631746
1 parent b524e34 commit ed4a551

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tools/templates/build_docs.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,15 @@ def gen_api_docs():
5555
# The below `del`'s are to avoid the api_gen_test to not document these.
5656
# Please remove these lines from your build_docs.py files when you create
5757
# them.
58-
del tensorflow_docs.google
59-
del tensorflow_docs.api_generator.report.schema
58+
try:
59+
del tensorflow_docs.google
60+
except AttributeError:
61+
pass
62+
63+
try:
64+
del tensorflow_docs.api_generator.report.schema
65+
except AttributeError:
66+
pass
6067

6168
doc_generator = generate_lib.DocGenerator(
6269
root_title=PROJECT_FULL_NAME,

0 commit comments

Comments
 (0)