python: Fixes for Python 3 (RHBZ#750889).

These fixes allow libguestfs bindings to work with Python 3 (tested
with Python 3.2)

You can select which Python you compile against by doing:

  PYTHON=python ./configure && make && make check

or:

  PYTHON=python3 ./configure && make && make check
(cherry picked from commit 2116f79cbc)
This commit is contained in:
Richard W.M. Jones
2011-11-02 19:43:53 +00:00
parent a936a9e1ed
commit a31bebe46f
5 changed files with 123 additions and 24 deletions

View File

@@ -168,7 +168,7 @@ py_guestfs_set_event_callback (PyObject *self, PyObject *args)
snprintf (key, sizeof key, "_python_event_%d", eh);
guestfs_set_private (g, key, py_callback);
py_eh = PyInt_FromLong ((long) eh);
py_eh = PyLong_FromLong ((long) eh);
return py_eh;
}