Skip to content

Commit 99ee1dc

Browse files
MarkDaoustcopybara-github
authored andcommitted
Split up parser.py: move out signature-handling.
Pure-refactor, no behavior changes. PiperOrigin-RevId: 416780389
1 parent 3752702 commit 99ee1dc

File tree

5 files changed

+988
-906
lines changed

5 files changed

+988
-906
lines changed

tools/tensorflow_docs/api_generator/generate_lib.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
from tensorflow_docs.api_generator import parser
3232
from tensorflow_docs.api_generator import pretty_docs
3333
from tensorflow_docs.api_generator import public_api
34+
from tensorflow_docs.api_generator import signature
3435
from tensorflow_docs.api_generator import traverse
3536
from tensorflow_docs.api_generator.report import utils
3637

@@ -137,15 +138,12 @@ def deprecated(self):
137138
if 'tf.contrib' in self.full_name:
138139
return True
139140

140-
try:
141-
# Instead of only checking the docstring, checking for the decorator
142-
# provides an additional level of certainty about the correctness of the
143-
# the application of `status: deprecated`.
144-
decorator_list = parser.extract_decorators(self.py_object)
145-
if any('deprecat' in dec for dec in decorator_list):
146-
return self._check_docstring()
147-
except AttributeError:
148-
pass
141+
# Instead of only checking the docstring, checking for the decorator
142+
# provides an additional level of certainty about the correctness of the
143+
# the application of `status: deprecated`.
144+
decorator_list = signature.extract_decorators(self.py_object)
145+
if any('deprecat' in dec for dec in decorator_list):
146+
return self._check_docstring()
149147

150148
return False
151149

0 commit comments

Comments
 (0)