diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-05-05 22:31:58 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-05-05 22:31:58 (GMT) |
commit | b173f7853e4e3a4215a661d98174291e379cf6fb (patch) | |
tree | 02735987f20fc27277a82c14c5da5e043cc134aa /Modules/datetimemodule.c | |
parent | c679fd8efcae2b5d1117fc09380d74f0000086b0 (diff) | |
download | cpython-b173f7853e4e3a4215a661d98174291e379cf6fb.zip cpython-b173f7853e4e3a4215a661d98174291e379cf6fb.tar.gz cpython-b173f7853e4e3a4215a661d98174291e379cf6fb.tar.bz2 |
add a replacement API for PyCObject, PyCapsule #5630
All stdlib modules with C-APIs now use this.
Patch by Larry Hastings
Diffstat (limited to 'Modules/datetimemodule.c')
-rw-r--r-- | Modules/datetimemodule.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Modules/datetimemodule.c b/Modules/datetimemodule.c index 0c6e664..8ba3474 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. |