qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 11/14] qapi/doc.py: Don't use private attributes of QAPIGen prope


From: John Snow
Subject: [PATCH 11/14] qapi/doc.py: Don't use private attributes of QAPIGen property
Date: Tue, 22 Sep 2020 17:17:59 -0400

Use the new __bool__ method to do the same without exposing the private
attribute.

Signed-off-by: John Snow <jsnow@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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]