From b173f7853e4e3a4215a661d98174291e379cf6fb Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Tue, 5 May 2009 22:31:58 +0000 Subject: add a replacement API for PyCObject, PyCapsule #5630 All stdlib modules with C-APIs now use this. Patch by Larry Hastings --- Modules/datetimemodule.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'Modules/datetimemodule.c') diff --git a/Modules/datetimemodule.c b/Modules/datetimemodule.c index 0c6e66444c..8ba3474275 100644 --- a/Modules/datetimemodule.c +++ b/Modules/datetimemodule.c @@ -4792,11 +4792,10 @@ PyInit_datetime(void) Py_INCREF(&PyDateTime_TZInfoType); PyModule_AddObject(m, "tzinfo", (PyObject *) &PyDateTime_TZInfoType); - x = PyCObject_FromVoidPtrAndDesc(&CAPI, (void*) DATETIME_API_MAGIC, - NULL); - if (x == NULL) - return NULL; - PyModule_AddObject(m, "datetime_CAPI", x); + x = PyCapsule_New(&CAPI, PyDateTime_CAPSULE_NAME, NULL); + if (x == NULL) + return NULL; + PyModule_AddObject(m, "datetime_CAPI", x); /* A 4-year cycle has an extra leap day over what we'd get from * pasting together 4 single years. -- cgit v1.2.1