On 16/11/23 02:43, John Snow wrote:
This needs parentheses to work how you want it to:

"%s-%s-%s" % 'a', 'b', 'c'
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
TypeError: not enough arguments for format string

"%s-%s-%s" % ('a', 'b', 'c')
'a-b-c'

Signed-off-by: John Snow <js...@redhat.com>
---
  scripts/qapi/schema.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index d739e558e9e..c79747b2a15 100644
--- a/scripts/qapi/schema.py
+++ b/scripts/qapi/schema.py
@@ -76,7 +76,7 @@ def __init__(self, name: str, info, doc, ifcond=None, 
features=None):
      def __repr__(self):
          if self.name is None:
              return "<%s at 0x%x>" % (type(self).__name__, id(self))
-        return "<%s:%s at 0x%x>" % type(self).__name__, self.name, id(self)
+        return "<%s:%s at 0x%x>" % (type(self).__name__, self.name, id(self))

This is commit 6d133eef98 ("qapi: Fix QAPISchemaEntity.__repr__()").


Reply via email to