Re: [libvirt-glib][PATCH 2/2] python: Introduce support for python3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 01, 2016 at 11:47:43AM +0200, Michal Privoznik wrote:
Just like libvirt itself is able to work with both major version
of python, libvirt-glib should do the same. Even the code I'm
introducing here is copied from there (and changed slightly to
reflect project name).

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
python/libvirt-glib.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)

diff --git a/python/libvirt-glib.c b/python/libvirt-glib.c
index 1daca36..8b3920d 100644
--- a/python/libvirt-glib.c
+++ b/python/libvirt-glib.c
@@ -17,11 +17,19 @@
#include <glib.h>
#include "libvirt-glib/libvirt-glib.h"

+#if PY_MAJOR_VERSION > 2
+# ifndef __CYGWIN__
+extern PyObject *PyInit_libvirtglibmod(void);
+# else
+extern PyObject *PyInit_cygvirtglibmod(void);
+# endif
+#else
#ifndef __CYGWIN__
extern void initlibvirtglibmod(void);
#else
extern void initcygvirtglibmod(void);
#endif

I'd expect this to be re-indented, but make syntax-check doesn't say
anything.  Other than that, I have no idea about glib, but the patches
work for me...

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]