Commit c83c0410 authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix build/sphinx_ext.py with tuple defaults for op params



When an OpCode's parameter has a tuple as default value, this code
will break:

  buf.write("defaults to ``%s``" % default)

The patch fixes this and other potential cases by always passing a
tuple to '%'.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichele Tartara <mtartara@google.com>
parent 67c15d8b
#
#
# Copyright (C) 2011, 2012 Google Inc.
# Copyright (C) 2011, 2012, 2013 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -160,15 +160,15 @@ def _BuildOpcodeParams(op_id, include, exclude, alias):
has_test = not (test is None or test is ht.NoType)
buf = StringIO()
buf.write("``%s``" % rapi_name)
buf.write("``%s``" % (rapi_name,))
if has_default or has_test:
buf.write(" (")
if has_default:
buf.write("defaults to ``%s``" % default)
buf.write("defaults to ``%s``" % (default,))
if has_test:
buf.write(", ")
if has_test:
buf.write("must be ``%s``" % test)
buf.write("must be ``%s``" % (test,))
buf.write(")")
yield buf.getvalue()
......@@ -329,8 +329,8 @@ def BuildValuesDoc(values):
"""
for name, doc in values:
assert len(doc.splitlines()) == 1
yield "``%s``" % name
yield " %s" % doc
yield "``%s``" % (name,)
yield " %s" % (doc,)
def _ManPageNodeClass(*args, **kwargs):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment