[libvirt] [libvirt-python PATCH] sanitytest: define long for python version >= 3

Ján Tomko jtomko at redhat.com
Tue Oct 7 11:01:50 UTC 2014


On 10/07/2014 11:49 AM, Pavel Hrdina wrote:
> On 10/07/2014 10:38 AM, Martin Kletzander wrote:
>> Commit c58c7f362aab37e4961407c2efc8a74925ed9c37 fixed 32-bit python
>> build but broke build with python3 due to the lack of 'long' in the
>> newer version of python.  This patch aims to fix it with a simple
>> string comparison of sys.version and '3'.
> 
> Actually the the int() type in python 3 is the same as long() type in
> python 2 and the int() from python 2 was removed.
> 
>>
>> Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
>> ---
>>   sanitytest.py | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/sanitytest.py b/sanitytest.py
>> index 5bd85a5..b161696 100644
>> --- a/sanitytest.py
>> +++ b/sanitytest.py
>> @@ -9,6 +9,9 @@ import string
>>   sys.path.insert(0, sys.argv[1])
>>   import libvirt
>>
>> +if sys.version > '3':
>> +    long = int
>> +
>>   # Path to the libvirt API XML file
>>   xml = sys.argv[2]
>>
> 
> ACK
> 

Thanks, pushed now.

Jan


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20141007/b106d4d3/attachment-0001.sig>


More information about the libvir-list mailing list