Mercurial > cpython-lru_cache-weakref
diff Modules/_cursesmodule.c @ 59998:d11fbc796499 legacy-trunk
Backported PyCapsule from 3.1, and converted most uses of
CObject to PyCapsule.
| author | Larry Hastings <larry@hastings.org> |
|---|---|
| date | Thu, 25 Mar 2010 00:54:54 +0000 |
| parents | 248a7ade444f |
| children | 736d6ce9b60b |
line wrap: on
line diff
--- a/Modules/_cursesmodule.c Thu Mar 25 00:51:58 2010 +0000 +++ b/Modules/_cursesmodule.c Thu Mar 25 00:54:54 2010 +0000 @@ -172,7 +172,7 @@ /* * Check the return code from a curses function and return None * or raise an exception as appropriate. These are exported using the - * CObject API. + * capsule API. */ static PyObject * @@ -2745,8 +2745,8 @@ return; ModDict = d; /* For PyCurses_InitScr to use later */ - /* Add a CObject for the C API */ - c_api_object = PyCObject_FromVoidPtr((void *)PyCurses_API, NULL); + /* Add a capsule for the C API */ + c_api_object = PyCapsule_New(PyCurses_API, PyCurses_CAPSULE_NAME, NULL); PyDict_SetItemString(d, "_C_API", c_api_object); Py_DECREF(c_api_object);
