Commit 21fb9114 authored by Neal Norwitz's avatar Neal Norwitz

Use a newer API for creating the module so we don't have to create

the docstring manually.  Saves code and a call to PyString_FromString.
parent 1ce1631f
...@@ -1358,14 +1358,11 @@ initbinascii(void) ...@@ -1358,14 +1358,11 @@ initbinascii(void)
PyObject *m, *d, *x; PyObject *m, *d, *x;
/* Create the module and add the functions */ /* Create the module and add the functions */
m = Py_InitModule("binascii", binascii_module_methods); m = Py_InitModule3("binascii", binascii_module_methods, doc_binascii);
if (m == NULL) if (m == NULL)
return; return;
d = PyModule_GetDict(m); d = PyModule_GetDict(m);
x = PyString_FromString(doc_binascii);
PyDict_SetItemString(d, "__doc__", x);
Py_XDECREF(x);
Error = PyErr_NewException("binascii.Error", PyExc_ValueError, NULL); Error = PyErr_NewException("binascii.Error", PyExc_ValueError, NULL);
PyDict_SetItemString(d, "Error", Error); PyDict_SetItemString(d, "Error", Error);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment