On 9/28/20 11:51 PM, Cleber Rosa wrote:
On Thu, Sep 24, 2020 at 08:28:18PM -0400, John Snow wrote:
For whatever reason, when these are stored as functions instead of
strings, it confuses sphinx-autodoc into believing them to be
docstrings, and it chokes on the syntax.


Interesting...

Keeping them as dumb strings instead avoids the problem.


I actually think it's a more honest approach, and easier to read.

Signed-off-by: John Snow <js...@redhat.com>
---
  scripts/qapi/doc.py | 40 ++++++++++++++++++++--------------------
  1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/scripts/qapi/doc.py b/scripts/qapi/doc.py
index c41e9d29f5..d12eda9e1e 100644
--- a/scripts/qapi/doc.py
+++ b/scripts/qapi/doc.py
@@ -8,26 +8,26 @@
  from qapi.gen import QAPIGenDoc, QAPISchemaVisitor
-MSG_FMT = """
+_MSG = '''
  @deftypefn {type} {{}} {name}
{body}{members}{features}{sections}
  @end deftypefn
-""".format
+'''


I know it doesn't make syntactic difference, but is there a reson for
also changing the quote style?

- Cleber.


Was just trying to differentiate it from docstrings to see if it helped. It didn't, but it also didn't hurt, so I left it.

Luckily, this patch won't matter after Peter Maydell's series goes in, so whatever!


Reply via email to