Rev 1053: Fix more issues with loading C modules. in file:///data/jelmer/bzr-svn/cext/

Jelmer Vernooij jelmer at samba.org
Mon Jun 2 22:12:51 BST 2008


At file:///data/jelmer/bzr-svn/cext/

------------------------------------------------------------
revno: 1053
revision-id: jelmer at samba.org-20080602211251-1u4jwgd736l7678p
parent: jelmer at samba.org-20080602202355-0p9vf1krh15dts0u
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: cext
timestamp: Mon 2008-06-02 23:12:51 +0200
message:
  Fix more issues with loading C modules.
modified:
  client.c                       client.pyx-20080313235339-wbyjbw2namuiql8f-1
  core.c                         core.pyx-20080313210413-17k59slolpfe5kdq-1
  ra.c                           ra.pyx-20080313140933-qybkqaxe3m4mcll7-1
  wc.c                           wc.pyx-20080313142018-10l8l23vha2j9e6b-1
=== modified file 'client.c'
--- a/client.c	2008-06-02 20:15:47 +0000
+++ b/client.c	2008-06-02 21:12:51 +0000
@@ -412,14 +412,14 @@
     .tp_methods = client_methods,
     .tp_dealloc = client_dealloc,
     .tp_new = client_new,
-	.tp_getset = client_getset,
+	.tp_getset = client_getset
 };
 
 void initclient(void)
 {
     PyObject *mod;
 
-    if (PyType_Check(&Client_Type) < 0)
+    if (PyType_Ready(&Client_Type) < 0)
         return;
 
 	/* Make sure APR is initialized */
@@ -429,6 +429,6 @@
     if (mod == NULL)
         return;
 
+    Py_INCREF(&Client_Type);
     PyModule_AddObject(mod, "Client", (PyObject *)&Client_Type);
-    Py_INCREF(&Client_Type);
 }

=== modified file 'core.c'
--- a/core.c	2008-06-02 20:15:47 +0000
+++ b/core.c	2008-06-02 21:12:51 +0000
@@ -78,8 +78,11 @@
     ret = PyDict_New();
     for (idx = apr_hash_first(pool, cfg_hash); idx != NULL; 
 		 idx = apr_hash_next(idx)) {
+		PyObject *data;
         apr_hash_this(idx, (const void **)&key, &klen, (void **)&val);
-        PyDict_SetItemString(ret, key, PyString_FromString(val));
+		data = Py_None;	
+		/* FIXME data = PyString_FromString(val); */
+        PyDict_SetItemString(ret, key, data);
 	}
     apr_pool_destroy(pool);
     return ret;

=== modified file 'ra.c'
--- a/ra.c	2008-06-02 19:13:37 +0000
+++ b/ra.c	2008-06-02 21:12:51 +0000
@@ -1092,6 +1092,7 @@
 PyTypeObject AuthProvider_Type = { 
 	PyObject_HEAD_INIT(&PyType_Type) 0,
 	.tp_name = "ra.AuthProvider",
+	.tp_basicsize = sizeof(AuthProviderObject),
 	.tp_dealloc = auth_provider_dealloc,
 };
 

=== modified file 'wc.c'
--- a/wc.c	2008-06-02 19:13:37 +0000
+++ b/wc.c	2008-06-02 21:12:51 +0000
@@ -681,22 +681,22 @@
 {
 	PyObject *mod;
 
-	if (PyType_Check(&Entry_Type) < 0)
-		return;
-
-	if (PyType_Check(&Adm_Type) < 0)
-		return;
-
-	if (PyType_Check(&Editor_Type) < 0)
-		return;
-
-	if (PyType_Check(&FileEditor_Type) < 0)
-		return;
-
-	if (PyType_Check(&DirectoryEditor_Type) < 0)
-		return;
-
-	if (PyType_Check(&TxDeltaWindowHandler_Type) < 0)
+	if (PyType_Ready(&Entry_Type) < 0)
+		return;
+
+	if (PyType_Ready(&Adm_Type) < 0)
+		return;
+
+	if (PyType_Ready(&Editor_Type) < 0)
+		return;
+
+	if (PyType_Ready(&FileEditor_Type) < 0)
+		return;
+
+	if (PyType_Ready(&DirectoryEditor_Type) < 0)
+		return;
+
+	if (PyType_Ready(&TxDeltaWindowHandler_Type) < 0)
 		return;
 
 	apr_initialize();




More information about the bazaar-commits mailing list