Use the new __bool__ method to do the same without exposing the private attribute.
Signed-off-by: John Snow <js...@redhat.com> --- scripts/qapi/doc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/qapi/doc.py b/scripts/qapi/doc.py index 5f2b0cd51d..2914e93b1c 100644 --- a/scripts/qapi/doc.py +++ b/scripts/qapi/doc.py @@ -344,7 +344,7 @@ def visit_event(self, self._gen.add(texi_msg('Event', doc, ifcond, members)) def symbol(self, doc: QAPIDoc, entity: QAPISchemaEntity) -> None: - if self._gen._body: + if self._gen: self._gen.add('\n') self.cur_doc = doc entity.visit(self) @@ -352,7 +352,7 @@ def symbol(self, doc: QAPIDoc, entity: QAPISchemaEntity) -> None: def freeform(self, doc: QAPIDoc) -> None: assert not doc.args - if self._gen._body: + if self._gen: self._gen.add('\n') self._gen.add(texi_body(doc) + texi_sections(doc, None)) -- 2.26.2