diff Modules/_elementtree.c @ 53816:911df82bc25d

add a replacement API for PyCObject, PyCapsule #5630 All stdlib modules with C-APIs now use this. Patch by Larry Hastings
author Benjamin Peterson <benjamin@python.org>
date Tue, 05 May 2009 22:31:58 +0000
parents 87fbbf22adf3
children 7a18c2762886
line wrap: on
line diff
--- a/Modules/_elementtree.c	Tue May 05 22:14:50 2009 +0000
+++ b/Modules/_elementtree.c	Tue May 05 22:31:58 2009 +0000
@@ -2809,7 +2809,7 @@
 
 #if defined(USE_PYEXPAT_CAPI)
     /* link against pyexpat, if possible */
-    capi = PyCObject_Import("pyexpat", "expat_CAPI");
+    capi = PyCapsule_Import(PyExpat_CAPSULE_NAME, 0);
     if (capi &&
         strcmp(capi->magic, PyExpat_CAPI_MAGIC) == 0 &&
         capi->size <= sizeof(*expat_capi) &&