提交 9170ba15 编写于 作者: C Claudio Bley

apibuild.py: fix TypeError raised in except clause

When an exception happened inside the try clause in serialize_function,
a new exception was raised in the except clause subsequently:

Traceback (most recent call last):
  File "./apibuild.py", line 2529, in <module>
    rebuild("libvirt")
  File "./apibuild.py", line 2513, in rebuild
    builder.serialize()
  File "./apibuild.py", line 2467, in serialize
    self.serialize_function(output, function)
  File "./apibuild.py", line 2208, in serialize_function
    self.warning("Failed to save function %s info: " % name, `id.info`)
TypeError: warning() takes exactly 2 arguments (3 given)

Use the correct number of arguments for self.warning and print the
original exception to stderr.
上级 46b1d8cf
...@@ -2198,7 +2198,8 @@ class docBuilder: ...@@ -2198,7 +2198,8 @@ class docBuilder:
output.write(" <arg name='%s' type='%s' info='%s'/>\n" % (param[1], param[0], escape(param[2]))) output.write(" <arg name='%s' type='%s' info='%s'/>\n" % (param[1], param[0], escape(param[2])))
self.indexString(name, param[2]) self.indexString(name, param[2])
except: except:
self.warning("Failed to save function %s info: " % name, `id.info`) print >>sys.stderr, "Exception:", sys.exc_info()[1]
self.warning("Failed to save function %s info: %s" % (name, `id.info`))
output.write(" </%s>\n" % (id.type)) output.write(" </%s>\n" % (id.type))
def serialize_exports(self, output, file): def serialize_exports(self, output, file):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册