[Libvir] Python bindings, errors & exceptions

Richard W.M. Jones rjones at redhat.com
Fri Mar 23 13:02:37 UTC 2007


Daniel P. Berrange wrote:
> On Fri, Mar 23, 2007 at 12:12:56PM +0000, Richard W.M. Jones wrote:
[...]
>>   class virConnect:			# libvirtclass.py
>>     # ...
>>     def listNetworks(self):
[...]
>>
>>   static PyObject *			// libvir.c
>>   libvirt_virConnectListNetworks(PyObject *self ATTRIBUTE_UNUSED,
>> 			       PyObject *args) {
[...]
> Yes, returning None here is totally bogus - it should be raising a
> libvirtError object.

Which code is wrong here?  From looking at this it was my impression 
that listNetworks is autogenerated by generator.py, and all the code in 
libvir.c is hand-written, but you say:

> Indeed they should - all the generated C code bindings do - its just a few
> of these hand written bindings that are wrong.

Rich.

-- 
Emerging Technologies, Red Hat  http://et.redhat.com/~rjones/
64 Baker Street, London, W1U 7DF     Mobile: +44 7866 314 421
  "[Negative numbers] darken the very whole doctrines of the equations
  and make dark of the things which are in their nature excessively
  obvious and simple" (Francis Maseres FRS, mathematician, 1759)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070323/fa49e061/attachment-0001.bin>


More information about the libvir-list mailing list