pygobject r747 - in trunk: . gobject



Author: paulp
Date: Sun Mar  2 00:05:03 2008
New Revision: 747
URL: http://svn.gnome.org/viewvc/pygobject?rev=747&view=rev

Log:
2008-03-02  Paul Pogonyshev  <pogonyshev gmx net>

	* gobject/gobjectmodule.c (REGISTER_TYPE): Never override customly
	set 'tp_new' and 'tp_alloc'.


Modified:
   trunk/ChangeLog
   trunk/gobject/gobjectmodule.c

Modified: trunk/gobject/gobjectmodule.c
==============================================================================
--- trunk/gobject/gobjectmodule.c	(original)
+++ trunk/gobject/gobjectmodule.c	Sun Mar  2 00:05:03 2008
@@ -3542,8 +3542,10 @@
 
 #define REGISTER_TYPE(d, type, name) \
     type.ob_type = &PyType_Type; \
-    type.tp_alloc = PyType_GenericAlloc; \
-    type.tp_new = PyType_GenericNew; \
+    if (!type.tp_alloc) \
+	type.tp_alloc = PyType_GenericAlloc; \
+    if (!type.tp_new) \
+	type.tp_new = PyType_GenericNew; \
     if (PyType_Ready(&type)) \
 	return; \
     PyDict_SetItemString(d, name, (PyObject *)&type);



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