diff options
author | Larry Hastings <larry@hastings.org> | 2010-03-25 00:54:54 (GMT) |
---|---|---|
committer | Larry Hastings <larry@hastings.org> | 2010-03-25 00:54:54 (GMT) |
commit | 402b73fb8d54ec2b24b52fdd77d389d903fa6c44 (patch) | |
tree | ced928b7f7dce754142742e485ed8e836fbc9486 /Modules/datetimemodule.c | |
parent | 53ff86ea5f0ed27f5eb5b966faf59dac298d6672 (diff) | |
download | cpython-402b73fb8d54ec2b24b52fdd77d389d903fa6c44.zip cpython-402b73fb8d54ec2b24b52fdd77d389d903fa6c44.tar.gz cpython-402b73fb8d54ec2b24b52fdd77d389d903fa6c44.tar.bz2 |
Backported PyCapsule from 3.1, and converted most uses of
CObject to PyCapsule.
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 7b9e271..3f1eb57 100644 --- a/Modules/datetimemodule.c +++ b/Modules/datetimemodule.c @@ -4856,11 +4856,10 @@ initdatetime(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; - 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. |