summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Ehresman <jpe@wingware.com>2010-04-15 18:34:38 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2010-04-16 13:02:42 -0400
commit30627eeecd9636290608cd7285d61aca3688437f (patch)
tree3cd32b37d66487bef656d25ed8619078d151e74d
parentc572ab6f587bb5a4d4501ea04bf7f98a2138e540 (diff)
downloadpygobject-30627eeecd9636290608cd7285d61aca3688437f.tar.gz
pygobject-30627eeecd9636290608cd7285d61aca3688437f.tar.xz
pygobject-30627eeecd9636290608cd7285d61aca3688437f.zip
Allow GPid instances to be created
-rw-r--r--glib/pygspawn.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/glib/pygspawn.c b/glib/pygspawn.c
index f816f99..dcfade6 100644
--- a/glib/pygspawn.c
+++ b/glib/pygspawn.c
@@ -255,7 +255,13 @@ pyglib_spawn_async(PyObject *object, PyObject *args, PyObject *kwargs)
void
pyglib_spawn_register_types(PyObject *d)
{
- PyGPid_Type.tp_base = &_PyLong_Type;
+#if PY_VERSION_HEX >= 0x03000000
+ PyGPid_Type.tp_base = &PyLong_Type;
+ PyGPid_Type.tp_new = PyLong_Type.tp_new;
+#else
+ PyGPid_Type.tp_base = &PyInt_Type;
+#endif
+
PyGPid_Type.tp_flags = Py_TPFLAGS_DEFAULT;
PyGPid_Type.tp_methods = pyg_pid_methods;
PyGPid_Type.tp_init = pyg_pid_tp_init;