From 30627eeecd9636290608cd7285d61aca3688437f Mon Sep 17 00:00:00 2001 From: John Ehresman Date: Thu, 15 Apr 2010 18:34:38 -0400 Subject: Allow GPid instances to be created --- glib/pygspawn.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; -- cgit