On 01/10/2011 02:07 PM, Laine Stump wrote:
On 01/10/2011 12:36 PM, Cole Robinson wrote:
> On 12/08/2010 10:12 AM, Cole Robinson wrote:
>>> On Fedore 14, virt-manager spews a bunch of warnings to the console:
>>>
>>> /usr/lib64/python2.7/site-packages/libvirt.py:1781:
PendingDeprecationWarning: The CObject type is marked Pending Deprecation in Python 2.7.
Please use capsule objects instead.
>>>
>>> Have libvirt use the capsule API if available. I've verified this
compiles
>>> fine on older python (2.6 in RHEL6 which doesn't have capsules), and
>>> virt-manager seems to function fine.
> ping? I think this should be a safe change.
>
> - Cole
>
>>> ---
>>> python/typewrappers.c | 89
+++++++++++++++++++++++++++---------------------
>>> 1 files changed, 50 insertions(+), 39 deletions(-)
>>>
>>> diff --git a/python/typewrappers.c b/python/typewrappers.c
>>> index 733aa20..e39d3cd 100644
>>> --- a/python/typewrappers.c
>>> +++ b/python/typewrappers.c
>>> @@ -16,6 +16,26 @@
To paraphrase Eric, I'm not a python expert, but...
a mechanical review shows that:
1) All instances of PyCObject_FromVoidPtrAndDesc were replaced with the
new function libvirt_buildPyObject() (ie none were left out, and the
arguments weren't changed except to remove the now-unnecessary typecasts).
2) There seem to be no other similar functions in use
("PyCObject_FromSmurf(), or whatever, (if such a thing even exists))
3) Looking at the replacement function, it properly duplicates the
previous functionality of
PyCObject_FromVoidPtrAndDesc()when Py_Capsule_H isn't defined, and
4) I'll take your word that it works properly when Py_Capsule_H is defined.
So lacking any other ACK, you can have mine :-)
Thanks! pushed now.
- Cole