diff options
author | Daniel P. Berrangé <berrange@redhat.com> | 2019-12-04 10:27:36 +0000 |
---|---|---|
committer | Daniel P. Berrangé <berrange@redhat.com> | 2019-12-04 12:14:51 +0000 |
commit | b22e4f2441078aec048b9503fde2b45e78710ce1 (patch) | |
tree | 9c06bcc560e4002401e3733aa22f79354d364300 /libvirt-override.c | |
parent | e3fa4f22d5e9301e98a4d5bd420dee7d64150d64 (diff) | |
download | libvirt-python-b22e4f2441078aec048b9503fde2b45e78710ce1.tar.gz |
Drop support for python 2
python2 will be end of life by the time of the next
libvirt release. All our supported build targets, including
CentOS7, have a python3 build available.
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'libvirt-override.c')
-rw-r--r-- | libvirt-override.c | 51 |
1 files changed, 10 insertions, 41 deletions
diff --git a/libvirt-override.c b/libvirt-override.c index 2e24d27..4e4c00a 100644 --- a/libvirt-override.c +++ b/libvirt-override.c @@ -4,13 +4,13 @@ * entry points where an automatically generated stub is * unpractical * - * Copyright (C) 2005, 2007-2015 Red Hat, Inc. + * Copyright (C) 2005-2019 Red Hat, Inc. * * Daniel Veillard <veillard@redhat.com> */ /* Horrible kludge to work around even more horrible name-space pollution - via Python.h. That file includes /usr/include/python2.5/pyconfig*.h, + via Python.h. That file includes /usr/include/python3.x/pyconfig*.h, which has over 180 autoconf-style HAVE_* definitions. Shame on them. */ #undef HAVE_PTHREAD_H @@ -25,18 +25,10 @@ #include "build/libvirt.h" #include "libvirt-utils.h" -#if PY_MAJOR_VERSION > 2 -# ifndef __CYGWIN__ +#ifndef __CYGWIN__ extern PyObject *PyInit_libvirtmod(void); -# else -extern PyObject *PyInit_cygvirtmod(void); -# endif #else -# ifndef __CYGWIN__ -extern void initlibvirtmod(void); -# else -extern void initcygvirtmod(void); -# endif +extern PyObject *PyInit_cygvirtmod(void); #endif #if 0 @@ -10553,14 +10545,13 @@ static PyMethodDef libvirtMethods[] = { {NULL, NULL, 0, NULL} }; -#if PY_MAJOR_VERSION > 2 static struct PyModuleDef moduledef = { PyModuleDef_HEAD_INIT, -# ifndef __CYGWIN__ +#ifndef __CYGWIN__ "libvirtmod", -# else +#else "cygvirtmod", -# endif +#endif NULL, -1, libvirtMethods, @@ -10571,11 +10562,11 @@ static struct PyModuleDef moduledef = { }; PyObject * -# ifndef __CYGWIN__ +#ifndef __CYGWIN__ PyInit_libvirtmod -# else +#else PyInit_cygvirtmod -# endif +#endif (void) { PyObject *module; @@ -10587,25 +10578,3 @@ PyInit_cygvirtmod return module; } -#else /* ! PY_MAJOR_VERSION > 2 */ -void -# ifndef __CYGWIN__ -initlibvirtmod -# else -initcygvirtmod -# endif -(void) -{ - if (virInitialize() < 0) - return; - - /* initialize the python extension module */ - Py_InitModule((char *) -# ifndef __CYGWIN__ - "libvirtmod", -# else - "cygvirtmod", -# endif - libvirtMethods); -} -#endif /* ! PY_MAJOR_VERSION > 2 */ |