[pygobject/py3k] Allow GPid instances to be created



commit 7172909f183eadca0f66f75a9d5ccc79bdda314e
Author: John Ehresman <jpe wingware com>
Date:   Thu Apr 15 18:34:38 2010 -0400

    Allow GPid instances to be created

 glib/pygspawn.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/glib/pygspawn.c b/glib/pygspawn.c
index 3471b4a..7d3a12f 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;



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